How to enable PHP errors in OSX Lion?

I cannot get my installation to display PHP errors. The only thing I see is the WSOD.

I updated the php.ini file:

(excerpt from phpinfo ())

display_errors On On display_startup_errors On On error_reporting 30719 30719 

Any ideas?

+4
source share
2 answers

If you are using the standard Apache installation on OSX you need to edit /etc/php.ini , however if you are using the MacPorts installation you will need to edit /opt/local/etc/php5/php.ini

You indicate that your phpinfo() indicates that errors are included. If they are not displayed, they must be redefined.

Places to check

  • httpd.conf , httpd-vhosts.conf and other configuration files in /etc/apache2/extras (not sure about MacPorts paths). Find the php_value lines.
  • .htaccess files - Find the php_value lines php_value .
  • .user.ini files - PHP 5.3+ supports directory configuration such as Apache.
  • Your scripts yourself. They can implement their own error handlers that disable error messages using ini_set .

You can try to enable at the script level using the following:

 ini_set('error_reporting', -1); ini_set('display_errors', 1); ini_set('html_errors', 1); // I use this because I use xdebug. 0:: // My favourite kind of error. 
+5
source

You can enable error reporting for one script with this one liner without making any permanent changes to the configuration files.

 error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); 
0
source

Source: https://habr.com/ru/post/1395178/


All Articles