Apache error log shows html of other sites on server

vancanneyt

Verified User
Joined
Dec 13, 2012
Messages
93
Normaly the error log would only show errors but the last few weeks i notice that every line contains a bunch of html code of the users website but also from other websites on the server.
Example line
Code:
[Sun Aug 31 16:32:53.295347 2014] [proxy_fcgi:error] [pid 14369:tid 140408115898112] [client xxx.xxx.xxx.xxx:51290] AH01071: Got error 'PHP message: PHP Fatal error:  Cannot redeclare class someclass in /home/user/domains/domain.com/public_html/file.php on line 2\nContent-type: text/html\r\n\r\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html>\n<head>\n    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />\n        <meta http-equiv='refresh' content='2;url=?directory=.&auto=1&currentPic=6'>\n\n<SCRIPT language="JavaScript">\n<!-- \n//preload the next image...\nif (document.images)\n{\n    pic1= new Image(800,600); \n    pic1.src="./Zonnepanelen8.JPG"; \n}\n//-->\n</SCRIPT>\n\n<title>PHPSlideshow by greg lawler at zinkwazi.com</title>\n\n<style type="text/css">\nbody {\t\n\tbackground:white;\n\ttext-align:center;\n\tfont-size:10px;\n\tfont-family:Verdana, Helvetica, sans-serif;\n\tcolor:black;\n\t}\n.image_info#\x05\xdfO\xb3\x7f'

Anybody got an idea how to fix this?
 
Hello,

You probably need to re-define log_errors in php.ini:

log_errors boolean
Tells whether script error messages should be logged to the server's error log or error_log. This option is thus server-specific.​
and/or error_log in php.ini:

error_log string
Name of the file where script errors should be logged. The file should be writable by the web server's user. If the special value syslog is used, the errors are sent to the system logger instead. On Unix, this means syslog(3) and on Windows NT it means the event log. The system logger is not supported on Windows 95. See also: syslog(). If this directive is not set, errors are sent to the SAPI error logger. For example, it is an error log in Apache or stderr in CLI. See also error_log().​

http://php.net/manual/en/errorfunc.configuration.php
 
It logs the error correctly, but like you see in the example, it adds a lot of extra's to it that don't belong there. Why is there html-output of a website added after an error log was written to the file? And why is that extra html-output from other sites on the server.
If you look at the example you'll see that after the error message the normal "line ending" \n gets a bunch of extra output that's been written and does not belong there.

PHP5.5 is running as FPM on Apache 2.4.9, all log entries are written to the users "Apache error log".
 
It logs the error correctly, but like you see in the example, it adds a lot of extra's to it that don't belong there. Why is there html-output of a website added after an error log was written to the file? And why is that extra html-output from other sites on the server.
If you look at the example you'll see that after the error message the normal "line ending" \n gets a bunch of extra output that's been written and does not belong there.

PHP5.5 is running as FPM on Apache 2.4.9, all log entries are written to the users "Apache error log".

Hello,

Same problem here:

DA 1.46.3
Apache 2.4.10
PHP-FPM 5.5.18

In almost all error log files for each domain, appears html code from different domains of other users:

Code:
[COLOR=#008000][B][Thu Nov 06 01:19:00.968011 2014] [proxy_fcgi:error] [pid 10013:tid 140657049970432] [client xx.xx.xx.xx:57311] AH01071: Got error 'PHP message: PHP Parse error:  syntax error, unexpected '?>' in /home/USER/domains/DOMAIN/public_html/test.php on line 5[/B][/COLOR][COLOR=#ff0000][I]\n<param><value><string>5201314</string></value></param></params></methodCall>Type: text/html; charset=UTF-8\r\nSet-Cookie: wordpress_test_cookie=WP+Cookie+check; path=/\r\nX-Frame-Options: SAMEORIGIN\r\n\r\n<!DOCTYPE html> <!--[if IE 8]><html\nxmlns="http://www.w3.org/1999/xhtml" class="ie8" lang="es-ES"> <![endif]--> <!--[if !(IE 8) ]><!--><html\nxmlns="http://www.w3.org/1999/xhtml" lang="es-ES"> <!--<![endif]--><head><link\nrel='stylesheet' href=...[/I][/COLOR]

In green the correct error from test file, in red the html code from other domain, every time the html code that is added at the end of each error comes from a different domain/user without any specific pattern...

It is very strange :confused:

EDIT: I just tested with other Apache errors, eg "authz_core:error" and the problem not occurs, only with php-fpm errors "proxy_fcgi:error" appears html code from other sites.
 
Last edited:
Hi,

After searching and searching, try several things and compare configurations and versions between dedicated servers we have with DirectAdmin, I have been able to reduce the cause of the problem since using the apache module "mod_proxy_fcgi", since CustomBuild changed to use the module "mod_fcgid" to use the module "mod_proxy_fcgi" the problem occurs.


I hope smtalk reads this and can explain or help, I guess many others have this same problem.

Thank.
 
I have the same problem.

DA 1.46.3
Apache 2.4.10
PHP-FPM 5.6.3 (I guess it's the same version as php, or do I need to look elsewhere?)

Only after reading this thread did I double-check what kind of code is appended in the logs. I thought it's a "feature" that I still need to turn off somewhere, but yeah, it's code from *whereever*, sometimes from the same site, but sometimes not.

Anyone reported this yet?
 
I've also noticed this problem and I'm using PHP 5.4.35 (php-fpm version). Any updates on this issue?
 
I added the fix to CB 2.0 rev. 1156. A simple "./build update; ./build apache" will solve it using revision 1156 (it's not available on DA fileservers yet).
 
Back
Top