0

I am getting the blank screen. No errors in the Apache logs, nothing. I was thinking there may be a php syntax error and it quietly dies, but I have configured php.ini to display errors:

display_errors=On
html_errors=On
error_reporting=E_ALL | E_STRICT 
display_startup_errors=On

here are relevant php configurations loaded:

   display_errors   On  On
     display_startup_errors On
    enable_dl   Off Off
    enable_post_data_reading    On  On
    error_append_string no value    no value
    error_log   no value    no value
    error_prepend_string    no value    no value
    error_reporting 22527

Why is there no Apache error logs? How to trace Apache execution? any help is much appreciated. Thank you

Update: I was wrong, Apache writes log only once on restart at the time of restart at the location specified by ErrorLog in the Apache Configuration, but nothing is written afterwards even when I get the blank site. Here logs from ErrorLog:

[Tue Nov 18 17:08:20.372970 2014] [mpm_prefork:notice] [pid 1601] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.4 configured -- resuming normal operations
[Tue Nov 18 17:08:20.376988 2014] [mpm_prefork:info] [pid 1601] AH00164: Server built: Jul 22 2014 14:36:39
[Tue Nov 18 17:08:20.377699 2014] [core:notice] [pid 1601] AH00094: Command line: '/usr/sbin/apache2'
[Tue Nov 18 17:19:32.301203 2014] [mpm_prefork:notice] [pid 1643] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.4 configured -- resuming normal operations
[Tue Nov 18 17:19:32.313839 2014] [mpm_prefork:info] [pid 1643] AH00164: Server built: Jul 22 2014 14:36:39
[Tue Nov 18 17:19:32.314481 2014] [core:notice] [pid 1643] AH00094: Command line: '/usr/sbin/apache2'
[Tue Nov 18 17:50:22.848631 2014] [core:info] [pid 1643] AH00096: removed PID file /var/run/apache2/apache2.pid (pid=1643)
[Tue Nov 18 17:50:22.848631 2014] [mpm_prefork:notice] [pid 1643] AH00169: caught SIGTERM, shutting down
[Tue Nov 18 17:50:25.288368 2014] [mpm_prefork:notice] [pid 3313] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.4 configured -- resuming normal operations
[Tue Nov 18 17:50:25.290696 2014] [mpm_prefork:info] [pid 3313] AH00164: Server built: Jul 22 2014 14:36:39
[Tue Nov 18 17:50:25.291613 2014] [core:notice] [pid 3313] AH00094: Command line: '/usr/sbin/apache2'

How to make Apache log for PHP errors or anything for that matter to be able troubleshoot issues?

latvian
  • 3,161
  • 9
  • 33
  • 62
  • `error_log = /some/path/to/php_errors.log` – AbraCadaver Nov 17 '14 at 19:29
  • Hi, try to fix this in your httpd.conf section [ErrorLog "logs/error.log]. may be that you do not have suffisant privileges to create this file. Also try to put an absolute path for your error log file. do not forget to restart your Apache Server – Halayem Anis Nov 17 '14 at 19:31
  • Thank you AbraCadaver. I did specify the error_log and checked in php configurations is loading the error_log configuration, however. No logs are are written. I created that log and gave all permissions(chmod 777). No success – latvian Nov 18 '14 at 23:57
  • Halayem, it is writing logs from starting Apache in the ErrorLog specified location in the Apache configurations, but nothing is reported afterwards from my blank php site....there is something going on with Apache 2.4.7 and php. The older version of Apache 2.4.7, i did never had to specify to display php syntax errors, now i had to. – latvian Nov 19 '14 at 00:02

1 Answers1

0

It turns out this was neither Apache nor PHP error, but an application level issue where there is ErrorHandler function declared that does hide all the php errors as described here: PHP's white screen of death

I came to conclusion to the fact that it is neither Apache nor PHP configurations by changing ErrorLevel to trace8 in virtual host settings:

 LogLevel trace8
 ErrorLog ${APACHE_LOG_DIR}/dev-virtual/error.log

Afterwards, I tail the logs specified in ErrorLog from command line and make requests. The logs showed:

[Tue Nov 18 18:16:37.398720 2014] [http:trace3] [pid 4054] http_filters.c(977): [client 10.88.12.0:49378] Response sent with status 200, headers:
...
[Tue Nov 18 18:16:37.399243 2014] [http:trace4] [pid 4054] http_filters.c(806): [client 10.88.12.0:49378]   Content-Length: 0
...

Here, the logs shows 200 response with Content-Length:0. The 200 is good response from Apache, so its not Apache error responsible for the blank page. Seeing the Content-Lenght set to 0, made me think there is something more than PHP setup/configuration issue. It was the ErrorHandler at the Application level.

Community
  • 1
  • 1
latvian
  • 3,161
  • 9
  • 33
  • 62