Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

200
Views
Difficulty debugging Magento 2 with xdebug without it calling writeClose()

As the title suggests, in some situations I step through the Magento 2 code, only for it to go to Magento\Framework\Session\SessionManager::writeClose(), thus calling session_write_close() and terminating the application immediately. The Call Stack is practically empty, so I can't see what is calling this. However if I insert a breakpoint and continue from there, it loads the website as if nothing has happened.

It only seems to occur on Magento 2 websites where it would suddenly terminate in such a fashion, however I'm not sure if it could be an issue with xdebug, Apache, or PHP-FPM.

Is there a reason why writeClose gets called, and how do I prevent this from occurring again whilst debugging?

System details:

  • Linux Ubuntu 18.04.2 LTS (in WSL)
  • PHP Version: 7.0.33
  • Server API: FPM/FastCGI
  • xdebug version: 2.8.1

If you require any additional information, then please leave a comment, and I shall update accordingly :-)

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

writeClose is called when you get an exception.

There is no way to prevent it.

The solution is to find where is the exception by debugging deeply.

When you debug then try to use F7 more instead of pressing F8 , you will go through all functionalities and get where the exception is. Then you see the root cause by exception messages.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!