PHP include_path='.:/opt/cpanel/ea-php70/root/usr/share/pear' 错误



我在我的wampServer(localhost(上测试我的php应用程序,它的一切都正常!但是,当我把同样的应用程序上传到我的网络服务器时,我得到了以下信息:

PHP致命错误:requireonce((:在第5行的/home/th27664/minierp.listemaids.com.br/header.PHP中打开必需的"util/DB_Connect.PHP"(include_path=".:/opt/cpanel/ea-php70/root/usr/share/pear"(失败

我不知道为什么,因为它与我在本地主机应用程序中使用的文件相同

这是我的部分代码:

<body class="animsition">
<?php 
require_once 'header.php';
require 'controller/controllerProduto.php';
require 'controller/ControllerEmitente.php';
$controle = new ControllerProduto();
$ControleEmitente = new ControllerEmitente();

重要细节:我的header.php文件位于该文件的同一文件夹中。

非常感谢!

请尝试使用类似root relative url

require_onex'/home/youraccount/public_htm/yourdirectory/header.php'

或类似absolute url

require_onex'http://yoursite.com/yourdirectory/header.php'

不要使用document relative url

可能问题出在.htaccess文件中。如果使用html扩展文件并在php上进行内部编写,则在.htaccess中应添加:AddType application / x-httpd-php5 .html

我在cPanel中修改了php fpm的系统默认配置(下面的yaml(,将phpopen_basedir设置为安全措施。从那以后,我还得到了你的include_path错误。

要修复,请添加以下内容:

php_value_include_path: 
name: php_value[include_path]
value: "[% documentroot %]"

注意压痕

收件人:

/var/cpanel/ApachePHPFPM/system_pool_defaults.yaml

然后,为了更好地衡量,我强制WHM通过使用WHM步骤重新处理文件:

  1. 主页»软件»MultiPHP管理器(系统PHP-FPM配置选项卡(
  2. 将最大请求数更改1(向上或向下(,然后向下滚动并点击保存配置
  3. 主页»重新启动服务»Apache的PHP-FPM服务(重新启动服务(

希望能有所帮助!

相关内容

最新更新