0
votes

I'm programming in php on my machine where I freshly installed:

  • Centos 6: centos-release-6-10.el6.centos.12.3.x86_64
  • Php 7 - PHP 7.0.31 (cli) (built: Jul 17 2018 15:40:48) ( NTS ) (Zen Engine 3.0.0)
  • Apache 2 - Server version: Apache/2.2.15 (Unix)

As fresh install nothing were logged. (first time this happens)

My php info tell me I have /etc/php.ini configuration file, where I have:

error_reporting = E_ALL

display_errors = Off

display_startup_errors = On

log_errors = On

log_errors_max_len = 0

html_errors = On

error_log = /var/log/httpd/php-error.log

On php info I see correct variables as wrote here.

In httpd.conf

ErrorLog "/var/log/httpd/error_log"

LogLevel debug

There is no ovewrite configuration in my virtualhost. I just tried debug to fix this issue, but nothing.

To make sure for me that anything can have access to log path, I used chmod 777 on the folders /var, /var/log, /var/log/httpd, and on error.log apache file. I didn't on php error file since it's not present, and as far as I know, Apache (or php) sould create it on it's own.

My php has eveident errors, and on different environment (with php 5) is naturally logged on apache log file.

I obviously restarted apache service at any change.

I searched really a lot before asking, and nothing that was suggested has never worked.

Am I really missing something?

Thanks. Riccardo

Update: After the best badge I could have earned: "Tumbleweed", I want to update with something more I tried:

  • I tried with code inside the php file:

ini_set("log_errors", 1);

ini_set("error_log", "/tmp/php-error.log");

error_log( "Hello, errors!" );

And nothing was logged.

  • display_errors = on in php.ini

This didn't work either

I'm really struggling programming without a error log...

Thanks to anyone.

1
Just tried this: perishablepress.com/advanced-php-error-handling-via-php for custom php.ini log, and it worked. I'm starting to think my php.ini default file is somehow broken. Hope this could help anyone to have error logs, but still, the default way doesn't works. - Raikoug

1 Answers

0
votes

Finally I got what was the problem.

Well.. maybe it is just MY problem...

By the way, with php 7.0 I had a php.ini corrupted file, I didn't see it had a lot of strange character.

I had to correct all the file and everything worked as a charme.

Hope anyone else could benefice from this.