`
fantaxy025025
  • 浏览: 1311447 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类

php-error-File(maintenance.inc.php) is not within the allowed path(s)

 
阅读更多

=

错误解决方案:php-error-with-zabbix-File(maintenance.inc.php) is not within the allowed path(s) 

=

[error] 8150#0: *13 FastCGI sent in stderr: "PHP message: PHP Warning:  require_once(): open_basedir restriction in effect. File(/etc/zabbix/web/maintenance.inc.php) is not within the allowed path(s): (/home/wwwroot/default/:/tmp/:/proc/) in /home/wwwroot/default/zabbix/include/classes/core/ZBase.php on line 271 

PHP message: PHP Warning:  require_once(/etc/zabbix/web/maintenance.inc.php): failed to open stream: Operation not permitted in /home/wwwroot/default/zabbix/include/classes/core/ZBase.php on line 271

PHP message: PHP Fatal error:  require_once(): Failed opening required '/etc/zabbix/web/maintenance.inc.php' (include_path='.:/usr/local/php/lib/php') in /home/wwwroot/default/zabbix/include/classes/core/ZBase.php on line 271" while reading response header from upstream, client: 10.2.3.12, server: _, request: "GET /zabbix/ HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi.sock:", host: "192.168.0.12"

2018/04/08 18:41:59 [info] 8150#0: *14 client closed connection while waiting for request, client: 10.2.3.12, server: 0.0.0.0:80

 

原因排查:

根据nginx的启动线程的权限是www:www,所以我已经修改了zabbix的目录以及/etc/zabbix/web 的目录权限,都是www,这样已经没有了权限问题。

已经重启过了fpm和nginx。

 

原因分析:根据两点:

1. File(/etc/zabbix/web/maintenance.inc.php) is not within the allowed path(s): (/home/wwwroot/default/:/tmp/:/proc/)

2. PHP Fatal error:  require_once(): Failed opening required '/etc/zabbix/web/maintenance.inc.php' (include_path='.:/usr/local/php/lib/php')

推测:应该是某个路径的权限不对。没有权限的原因是 is not within the allowed path(s)

应该去设置某个参数,把这个路径包涵进去。这个参数名应该叫:include_path

 

解决方法: 

寻找php的配置文件php.ini,找到参数include_path 发现没有设置。

那另一个配置在哪里呢?应该在httpd的配置里面或者nginx的配置里面。

由于我本次用了nginx而不是httpd,所以找到nginx里面的配置文件:

vi /usr/local/nginx/conf/fastcgi.conf

fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/

加入本次的报错的路径:

fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/:/etc/zabbix/web";

重新启动nginx和fastcgi,一切OK了。

/usr/local/nginx/sbin/nginx -s reload

/etc/init.d/php-fpm restart

 

 如果是httpd的,可能可以参考:

https://blog.csdn.net/lzp2011150309/article/details/50725737 php错误提示 open_basedir restriction in effect 解决

 

=

=

=

 

分享到:
评论

相关推荐

    net55-r8168-8.045a-napi.x86_64.rar

    2015-01-16: Version 8.039.01: Changed driver code to not use IP checksum hardware offload (caused various issues with networking in VMs) 2015-01-05: Version 8.039.00: Original version

    解决Tomcat跨域的jar包,java-property-utils-1.9.jar

    <param-name>cors.allowed.origins</param-name> <param-value>*</param-value> </init-param> <!-- 更多配置选项,如:允许的HTTP方法、允许的头部、是否允许证书等 --> <filter-mapping> <filter-name>...

    Tomcat解决跨域的两个jar包java-property-utils-1.9.jar和cors-filter-1.7.jar

    allowed.headers=Content-Type, Authorization, X-Requested-With allow.credentials=true exposed.headers=X-Total-Count, X-Custom-Header ``` 这里,`allowed.origins`指定了允许跨域的源,`allowed.methods...

    cors-filter-1.7.jar,java-property-utils-1.9.jar

    <param-name>cors.allowed.origins</param-name> <param-value>*</param-value> </init-param> <init-param> <param-name>cors.allowed.methods</param-name> <param-value>GET,POST,HEAD,OPTIONS,PUT,DELETE...

    PyPI 官网下载 | aws-cdk.aws-cloudfront-origins-1.97.0.tar.gz

    "allowed_methods": cloudfront.AllowedMethods.ALLOW_ALL, "cached_methods": cloudfront.CachedMethods.CACHE_GET_HEAD_OPTIONS, "default_ttl": core.Duration.minutes(5), }, ) ``` 在上面的例子中,我们...

    webgoat-standalone-7.1-SNAPSHOT-exec.jar

    Prerequisites: Java VM 1.8 Open a command shell/window, browse to where you ...Using the --help option will show the allowed command line arguments. 更多查看: https://github.com/WebGoat/WebGoat

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    connector's end point moving, the link is breaks if the move was not on one of the flex-controls connection points. Contain False as default. - ADD Added ControlDocRect parameter in event ...

    net-tulip-1.1.15-1.x86_64.rar

    在线封装和离线封装驱动 ... Description DECchip 21140 Ethernet driver (This driver allows running ESXi as a VM under Microsoft Hyper-V) ...Build instructions in the above mentioned forums' thread

    fastboot 2020年 android10版本 ubuntu linux平台

    Check whether unlocking is allowed (1) or not(0). advanced: erase PARTITION Erase a flash partition. format[:FS_TYPE[:SIZE]] PARTITION Format a flash partition. set_active SLOT Set the active ...

    jacob Hiding the application window is not allowed

    设置隐试打开PPT报错 Hiding the application window is not allowed

    QT 下载:Download from your IP address is not allowed

    Download from your IP address is not allowed 百度网盘永久连接: QT下载: qt-opensource-linux-x64-5.8.0.run: 链接:https://pan.baidu.com/s/1sQ3tqPaWdDnmhBYAc_XR7g qt-opensource-linux-x64-5.13.1....

    cors-filter-1.7 + java-property-utils-1.10.zip

    <param-name>cors.config.file</param-name> <param-value>/WEB-INF/cors.properties</param-value> </init-param> ``` 在`cors.properties`文件中,我们可以定义相应的配置: ``` cors.allowed.origins=...

    servlet2.4doc

    Causes the next filter in the chain to be invoked, or if the calling filter is the last filter in the chain, causes the resource at the end of the chain to be invoked. doFilter(ServletRequest, ...

    net51-r8169-6.011.00-2vft.510.0.0.799733.x86_64.rar

    在线封装和离线封装驱动 ... Description ...Adds the blacklisted ESXi 5.1 built-in ...Requires MaintMode Live Install Allowed Live Remove Allowed Stateless Ready Overlay Yes No No Yes No

    BURNINTEST--硬件检测工具

    port locks up in the Operating System, the error is still reported. - Corrected a bug, where in rare cases, the result summary could be duplicated in a log file. - Updated license management, in ...

    wget-1.11.4-1

    --ca-certificate=FILE file with the bundle of CA's. --ca-directory=DIR directory where hash list of CA's is stored. --random-file=FILE file with random data for seeding the SSL PRNG. --egd-file=...

    wp-o-matic.1.0RC4.zip

    Use the post template feature -located in campaign settings-. For example: {content} <p><a >Link to the original site</a></p> = Why isn’t the full article showing? = Because the feed you're using ...

    cors-filter-1.7.jar,cors-filter-2.5.jar,cors-filter-2.10.jar

    <param-name>cors.allowed.origins</param-name> <param-value>*</param-value> </init-param> <init-param> <param-name>cors.allowed.methods</param-name> <param-value>GET,POST,HEAD,OPTIONS</param-...

    net-e1000e-3.1.0.2-glr2.x86_64.rar

    Please note that this driver is obsolete, because with ESXi 5.5 Update 3 VMware introduced a newer version of e1000e which supports the same set of devices plus Intel i219 adapters (PCI IDs 8086:156f,...

    Diskeeper 2008 v12.0.759.0

    job is shown in the Log tab within the Diskeeper console. Additional information can also be stored in a log file. A wide variety of information can be saved for future reference. Simultaneous ...

Global site tag (gtag.js) - Google Analytics