pear include_path数据文件夹不再有效


pear include_path data folder is no longer valid

我有一个带有centOS LAMP堆栈的vps,以及多个域/ips。很久以前,我有一个更熟悉SSH的人在vps上安装了pear,我相信他是为一个特定的用户/域配置的,这个用户/域已经不存在了,现在pear正在抛出错误。

不再存在的旧用户/域是"ljsspin",但当我查看php.ini时,包含路径是:

include_path = ".:/usr/share/pear/:/usr/share/php:/var/www/ljsspin/data/pear/:"

我可以在ssh中执行pear命令,但我假设include路径的最后一部分不再存在是错误的原因。

因此,我的问题是如何将必要的/data/pear文件安装到新目录中?我尝试过升级pear,但也产生了一个错误(无法解包结构文件)。

感谢您的指导。

我收到的确切错误消息:

Warning: include() [function.include]: open_basedir restriction in effect. File(/usr/share/pear/Mail.php) is not within the allowed path(s): (/var/www/steve/data:.) in /var/www/steve/data/www/newdomain.com/admin/dashboard/includes/pdf.php on line 3
Warning: include(/usr/share/pear/Mail.php) [function.include]: failed to open stream: Operation not permitted in /var/www/steve/data/www/newdomain.com/admin/dashboard/includes/pdf.php on line 3
Warning: include() [function.include]: Failed opening 'Mail.php' for inclusion (include_path='.:/usr/share/pear/:/usr/share/php:/var/www/ljsspin/data/pear/:') in /var/www/steve/data/www/newdomain.com/admin/dashboard/includes/pdf.php on line 3

生效的open_basedir限制错误消息意味着您已经为open_basedirPHP指令设置了一个值,因此脚本不允许从给定的目录集之外读取文件,在您的情况下,这些目录是:

  • /var/www/steve/data
  • .

由于PEAR包安装在其他目录中:

  • /usr/share/pear/

PHP按照指示阻止脚本读取它们

如果您打算允许访问/usr/share/pear/,显然必须扩大限制。