我有以下设置:
问题是,一些配置为子域(v-host)的网站有时会报告这个奇怪的错误:
来自web46的PHP错误
[19-Mar-2015 18:39:07 UTC] PHP Warning: include(): open_basedir restriction in effect. File(/var/www/clients/client1/web3/cooltaxi/vendor/yiisoft/yii2/web/ErrorAction.php) is not within the allowed path(s): (/var/www/clients/client1/we$
[19-Mar-2015 18:39:07 UTC] PHP Warning: include(/var/www/clients/client1/web3/cooltaxi/vendor/yiisoft/yii2/web/ErrorAction.php): failed to open stream: Operation not permitted in /var/www/clients/client1/web3/cooltaxi/vendor/yiisoft/yi$
[19-Mar-2015 18:39:07 UTC] PHP Warning: include(): Failed opening '/var/www/clients/client1/web3/cooltaxi/vendor/yiisoft/yii2/web/ErrorAction.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/clients/clie$
[19-Mar-2015 18:39:07 UTC] PHP Warning: include(): open_basedir restriction in effect. File(/var/www/clients/client1/web3/cooltaxi/vendor/yiisoft/yii2/base/UnknownClassException.php) is not within the allowed path(s): (/var/www/clients$
[19-Mar-2015 18:39:07 UTC] PHP Warning: include(/var/www/clients/client1/web3/cooltaxi/vendor/yiisoft/yii2/base/UnknownClassException.php): failed to open stream: Operation not permitted in /var/www/clients/client1/web3/cooltaxi/vendor$
[19-Mar-2015 18:39:07 UTC] PHP Warning: include(): Failed opening '/var/www/clients/client1/web3/cooltaxi/vendor/yiisoft/yii2/base/UnknownClassException.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/c$
[19-Mar-2015 18:39:07 UTC] PHP Fatal error: Class 'yii\base\UnknownClassException' not found in /var/www/clients/client1/web3/cooltaxi/vendor/yiisoft/yii2/BaseYii.php on line 291
[19-Mar-2015 18:39:07 UTC] PHP Fatal error: Uncaught exception 'ReflectionException' with message 'Class yii\web\ErrorAction does not exist' in /var/www/clients/client1/web3/cooltaxi/vendor/yiisoft/yii2/di/Container.php:415
PHP-FPM池 - web46
[web46]
listen = /var/lib/php5-fpm/web46.sock
listen.owner = web3
listen.group = client1
listen.mode = 0660
user = web3
group = client1
pm = dynamic
pm.max_children = 10
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 5
pm.max_requests = 0
chdir = /
php_admin_value[open_basedir] = /var/www/clients/client1/web3/test:/var/www/clients/client1/web3/private:/var/www/clients/client1/web3/tmp:/var/www/test.agelis.cz/test:/srv/www/test.agelis.cz/test:/usr/share/php5:/usr/share/php:/tmp:/us$
php_admin_value[session.save_path] = /var/www/clients/client1/web3/tmp
php_admin_value[upload_tmp_dir] = /var/www/clients/client1/web3/tmp
php_admin_value[sendmail_path] = "/usr/sbin/sendmail -t -i -fwebmaster@test.agelis.cz"
php_admin_value[upload_max_filesize] = 128M
php_admin_value[post_max_size] = 128M
php_admin_value[max_input_vars] = 4000
PHP-FPM池 - web59
[web59]
listen = /var/lib/php5-fpm/web59.sock
listen.owner = web3
listen.group = client1
listen.mode = 0660
user = web3
group = client1
pm = dynamic
pm.max_children = 10
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 5
pm.max_requests = 0
chdir = /
php_admin_value[open_basedir] = /var/www/clients/client1/web3/cooltaxi:/var/www/clients/client1/web3/private:/var/www/clients/client1/web3/tmp:/var/www/cooltaxi.agelis.cz/cooltaxi:/srv/www/cooltaxi.agelis.cz/cooltaxi:/usr/share/php5:/us$
php_admin_value[session.save_path] = /var/www/clients/client1/web3/tmp
php_admin_value[upload_tmp_dir] = /var/www/clients/client1/web3/tmp
php_admin_value[sendmail_path] = "/usr/sbin/sendmail -t -i -fwebmaster@cooltaxi.agelis.cz"
Apache fcgi vhost config - web46
<IfModule mod_fastcgi.c>
<Directory /var/www/clients/client1/web3/cgi-bin>
Require all granted
</Directory>
<Directory /var/www/test.agelis.cz/test>
<FilesMatch "\.php[345]?$">
SetHandler php5-fcgi
</FilesMatch>
</Directory>
<Directory /var/www/clients/client1/web3/test>
<FilesMatch "\.php[345]?$">
SetHandler php5-fcgi
</FilesMatch>
</Directory>
Action php5-fcgi /php5-fcgi
Alias /php5-fcgi /var/www/clients/client1/web3/cgi-bin/php5-fcgi-88.86.115.169-443-test.agelis.cz
FastCgiExternalServer /var/www/clients/client1/web3/cgi-bin/php5-fcgi-88.86.115.169-443-test.agelis.cz -idle-timeout 300 -socket /var/lib/php5-fpm/web46.sock -pass-header Authorization
</IfModule>
它看起来像open_basedir问题,但奇怪的是,PHP由于某种原因从不同的池配置中获取open_basedir设置(你可以看到 - 错误来自web43,但路径来自web59)
php-fpm错误日志中没有输入。
任何帮助将不胜感激。我已经尝试了我所知道的一切,但仍然无法弄清楚问题: - (
答案 0 :(得分:1)
在遇到完全相同的问题并尝试修复它几周后,我终于想出了一个解决方案。
我认为问题源于将Apache服务器升级到2.4。自升级以来,我收到了这些错误消息。经过几个小时的尝试和错误&#34;我终于找到了howtoforge的提示,这似乎是ISPConfig最活跃的论坛。
看起来ISPConfig不会更新主配置文件,包括Apache和PHP-FPM。我想他们想要防止弄乱你修改过的主配置。那里的ISPConfig开发人员建议用ISPConfig GIT中的新主配置文件替换旧的主配置文件。我从提供的链接下载了以下文件:
并替换了/ usr / local / ispconfig / server / conf /中的当前配置文件。最后一步是使用ISPConfig更新所有创建的配置(工具 - &gt;重新同步 - &gt;重新同步网站)。由于这样做,我没有得到一个PHP-FPM错误。