1

I checked which php.ini is used with phpinfo(), so I'm editing the right php config file.

In that php.ini file (and in phpinfo() details) I have display_errors at On and error_reporting at E_ALL.

BUT when I have a PHP error, most of the time I find no log (in the file specified by error_log, nor in the file specified in apache vhost, nor in /var/syslog), and only a blank page displayed. I also tried to use the ini_set("display_errors", 1) but that didn't change anything.

One thing was weird, I had no php5 folder in /var/log (I created it, and configured error_log to use it).

Any idea would be much appreciated, that's not so great to code without knowing anything about the errors you have !

P.S. I'm using PHP 5.4 & Symfony2 (using the app_dev.php file), on Debian Wheezy.

Edit : Error logs now work thanks to @martinezjc , but still having a blank page in Apache.

Bonswouar
  • 1,521
  • 2
  • 17
  • 37
  • do php errors log to your specified error log if they are generated outside of a symfony2 application? I don't have symphony experience, but I wonder if the framework is handling the errors for you and logging them somewhere within the application. Just a guess though – Jacob Jul 08 '14 at 16:50
  • Actually only Symfony2 errors are displayed/logged. Like options missing, wrong route, etc.. – Bonswouar Jul 09 '14 at 08:30

1 Answers1

1

You can create a custom directory, remember to assign apache permission

mkdir /var/log/php-5-4
chown www-data /var/log/php-5-4

The in the php.ini file

error_log = /var/log/php-5-4/php_errors.log

This link talk about more about logs, you can check it http://doc.exyks.org/wiki/Server_php_log_configuration

martinezjc
  • 3,415
  • 3
  • 21
  • 29
  • Thank you, that worked for the logs, I forgot to change the permissions apparently. But what about displaying these errors instead of having a blank page in Apache ? – Bonswouar Jul 09 '14 at 09:20
  • you can set in the php.ini file the directive `display_errors = On` or use directly in your php file `ini_set('display_errors', '1');` :) – martinezjc Jul 09 '14 at 14:59
  • As I said in the original post, I already have `display_errors = On` in my `php.ini`, and I also already tried `ini_set('display_errors', '1');` in my php file. – Bonswouar Jul 10 '14 at 07:11