网站后台用的Zpanel时,网站没出现这样的错误,但转成WDCP后,面板后台在添加网站时,勾选了限制目录:
刚出现以下的警告:
Warning: Unknown: open_basedir restriction in effect. File(/home/admin/__processed_stats/webdomain.com.phplog) is not within the allowed path(s): (/www/web/webdomain_info/www:/tmp) in Unknown on line 0
如不勾选,则不会出错提示,查来查去,原来是.htaccess搞的鬼。
原因是:网站是很久前从Kloxo面板移过来的,自从kloxo被爆漏洞,被空间商列为黑名单后,就一直没关注过这CP。
这CP会修改.htaccess, 生成类似以下的优化内容:
###Start Kloxo PHP config Area
###Please Don't edit these comments or the content in between. kloxo uses this to recognize the lines it writes to the the file. If the above line is corrupted, it may fail to recognize them, leading to multiple lines.
<Ifmodule mod_php4.c>
php_value error_log "/home/admin/__processed_stats/Xxxx.com.phplog"
php_value upload_max_filesize 10M
php_value max_execution_time 30
php_value max_input_time 60
php_value memory_limit 32M
php_value post_max_size 18M
php_flag register_globals off
php_flag display_errors off
php_flag file_uploads on
php_flag log_errors off
php_flag output_buffering off
php_flag register_argc_argv on
php_flag magic_quotes_gpc off
php_flag magic_quotes_runtime off
php_flag magic_quotes_sybase off
php_flag mysql.allow_persistent off
php_flag register_long_arrays on
php_flag allow_url_fopen on
php_flag cgi.force_redirect on
php_flag enable_dl on
</Ifmodule>
<Ifmodule mod_php5.c>
php_value error_log "/home/admin/__processed_stats/Xxxx.com.phplog"
php_value upload_max_filesize 10M
php_value max_execution_time 30
php_value max_input_time 60
php_value memory_limit 32M
php_value post_max_size 18M
php_flag register_globals off
php_flag display_errors off
php_flag file_uploads on
php_flag log_errors off
php_flag output_buffering off
php_flag register_argc_argv on
php_flag magic_quotes_gpc off
php_flag magic_quotes_runtime off
php_flag magic_quotes_sybase off
php_flag mysql.allow_persistent off
php_flag register_long_arrays on
php_flag allow_url_fopen on
php_flag cgi.force_redirect on
php_flag enable_dl on
</Ifmodule>
###End Kloxo PHP config Area
现在的问题其实就出现在这句:
php_value error_log "/home/admin/__processed_stats/Xxxx.com.phplog"
直接把kloxo的配置全部删掉即可。