PHP exit status 255: what does it mean?

Solution 1:

255 is an error, I could reproduce that same exit code by having a fatal error.

This means that somehow your error reporting is hidden, there are some possible causes for this:

  • error_reporting is not defined and php reports no error at all
  • An @ (error suppression operator) hides the output of the error
  • STDERR is redirected somewhere else (php -f somefile.php 2>/dev/null, remove the redirection)
  • This could still be an internal error due to missing dependencies and that a fatal error has the same exit code as a program crash.

Solution 2:

It could also mean that /etc/php5/cli/php.ini (on Debian/Ubuntu) or /etc/php.ini (on RHEL/CentOS/etc.) has display_errors = Off which means that any errors or warnings from command-line scripts will go nowhere, unless log_errors = On (see also the error_log setting).

Try running your scripts with a wrapper script that uses php -d display_errors=on ...

Tags:

Php

Php5