0

I am running Apache 2.4.23 and PHP 5.6. Everything runs fine except a PHP script that is being silently dropped in the middle of its execution at a specific spot.

"display_errors" are On and error_reporting is set to E_ALL in php-5.6.ini. I have multiple error_log statement that I use as a trace to determine where execution stops and now surrounded the section in question with a try/catch that would do an error_log with the exception, but again only silence, both in Apache's error_log and php_error.log.

Max execution time and memory limit were already raised to twice the amount as per default and each error_log prints microtime() along with it, showing that the script is executed within a single second.

SOLUTION: VQMOD was interferring with Woocart, in particular with the parts of the code that Apache stopped from execution. After removing the corresponding VQMOD XML files it all ran fine again.

Peter O.
  • 55
  • 8
  • Have you checked the apache error_log? – topher Oct 17 '16 at 14:27
  • 1
    if you do `try { ... } catch (Exception $ex){ }` then you handle exception on your own and it will not propagate exception to error log, only if you throw exception again like `catch (Exception $ex){ throw $ex; }` – Marek Janoud Oct 17 '16 at 14:30
  • in your php.ini, add a line like `error_log = /usr/local/var/log/apache2/php_error_log` (whatever path you are comfy with. I get many 'fatal uncaught', in there. Restart apache and php-fpm if you use it. – YvesLeBorg Oct 17 '16 at 14:30
  • You may have experienced some php bug, try comment whole script and run, then uncomment a little bit from start and run, if everything's ok, uncomment even more and run, this way you could separate line that is causing the trouble – Buksy Oct 17 '16 at 14:31
  • @Buksy ... err, how about using an IDE with Xdebug, breakpoints and vars/state inspection capabilities? Also, it could also be some `php feature` where the failure is as per specs. – YvesLeBorg Oct 17 '16 at 14:39
  • The script finished fine when I place "return" at some early point. An IDE is not an option since it's part of an ecommerce plugin for WP and the code in question is a callback for Paypal. The catch block already does a "error_log ($ex)" so probably no reason to do a "throw ($ex)", right? – Peter O. Oct 17 '16 at 14:46
  • @YvesLeBorg I know this approach is the least intelligent, but most people doesnt have Xdebug and it can be parsing bug where xdebug woudnt get run at all ... this is the easiest way to find error line if no logs are available – Buksy Oct 17 '16 at 15:01
  • @PeterO. just a guess then. You may have a `require_once`-like instruction that tries to include and interpret a file with some basic syntax error, like an unclosed parens, quotation, `[]`. This would explain that it runs 'sometimes' , and the logging is dead-silent, ie the require only executes when the data dictates that path. Also, if an IDE is out of the question, you could open the files in a smart editor that can highlight basic syntax. – YvesLeBorg Oct 17 '16 at 15:25

0 Answers0