Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
lighttpd、php、fastcgi-通知、警告和错误显示的单个虚拟主机设置_Php_Lighttpd_Error Reporting_Virtual Hosts - Fatal编程技术网

lighttpd、php、fastcgi-通知、警告和错误显示的单个虚拟主机设置

lighttpd、php、fastcgi-通知、警告和错误显示的单个虚拟主机设置,php,lighttpd,error-reporting,virtual-hosts,Php,Lighttpd,Error Reporting,Virtual Hosts,我正在寻找一种在lighttpd上单独配置虚拟主机以显示或不显示错误和警告的方法 error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); 我喜欢通过虚拟hots配置来实现。不是来自php.ini $HTTP["host"] =~ "domain1\.com" { server.document-root = "/home/lighttpd/domain1.com/http" acces

我正在寻找一种在lighttpd上单独配置虚拟主机以显示或不显示错误和警告的方法

error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
我喜欢通过虚拟hots配置来实现。不是来自php.ini

$HTTP["host"] =~ "domain1\.com" {
            server.document-root = "/home/lighttpd/domain1.com/http"
            accesslog.filename   = "/home/lighttpd/domain1.com/logs/access.log"

            php_flag display_errors On ....???

}
如果您尝试上面的代码,会出现以下错误

root@web:~/lighttpd# /etc/init.d/lighttpd restart
2014-02-05 11:23:54: (configfile.c.932) source: /usr/share/lighttpd/mysql_vhost.py line: 8 pos: 24 parser failed somehow near here: display_errors
2014-02-05 11:23:54: (configfile.c.932) source: /etc/lighttpd/lighttpd.conf line: 32 pos: 1 parser failed somehow near here: (EOL)
有没有其他方法可以从lighttpd内部与PHP对话? PHP作为一个模块加载。
它应该是一个。

不确定,我们正在寻找这样的东西

<VirtualHost *:80>
    ServerName example.com
    DocumentRoot /var/www/domains/example.com/html
    ErrorLog /var/www/domains/example.com/apache.error.log
    CustomLog /var/www/domains/example.com/apache.access.log common
    php_flag log_errors on
    php_flag display_errors on
    php_value error_reporting 30719
    php_value error_log /var/www/domains/example.com/php.error.log
</VirtualHost>
根据文档,上述数字应启用“所有”错误,而不考虑版本,如果您想要更精细的设置,请手动或将值合并,或运行

或见下文

php_value error_reporting 6143 # for all errors notice, warnings, etc
php_value error_reporting 6135 #show warnings less strict

如果PHP在lighttpd下作为模块运行,那么您可以在virtualhost配置中添加以下代码:-

  php_flag display_errors off

我从pecl找到了htscanner。但我还不明白。好吧,我安装了它,它正在工作,但我不想从.htaccess解决它。。我想从虚拟主机上实现它。@deonia的回答会更有帮助。deonia已经给出了配置示例。你需要把这个放在VirtualHost标签里..我是@deonia?他发布了什么?这个解决方案不适用于lighttpd,它适用于apache2that's the apache语法。我正在寻找lighttpd语法。差不多和你在这里写的一样,只是为了lighttpd。再来一次。您不能将此类节(php_flag log_errors on…)放入lighttpd虚拟主机。你会得到一个错误<代码>root@web:~/lighttpd#/etc/init.d/lighttpd restart 2014-02-05 11:23:54:(configfile.c.932)source:/usr/share/lighttpd/mysql_vhost.py line:8 pos:24解析器在此处附近以某种方式失败:log_errors 2014-02-05 11:23:54:(configfile.c.932)source:/etc/lighttpd/lighttpd.conf行:32 pos:1解析器在此处附近以某种方式失败:(EOL)
  php_flag display_errors off