PHP错误的文件夹?include_path='.:/usr/share/php:/usr/share/pear'

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5824113/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 22:36:03  来源:igfitidea点击:

PHP wrong folder ? include_path='.:/usr/share/php:/usr/share/pear'

phppathwebserver

提问by CQM

I need to install this feature on my webserver. this error message is looking for /usr/share/phpCOLON /usr/share/pear

我需要在我的网络服务器上安装此功能。此错误消息正在寻找/usr/share/phpCOLON/usr/share/pear

my php installation rests in /usr/share/php5, and I do not have a /usr/share/pearfolder

我的 php 安装在/usr/share/php5,我没有/usr/share/pear文件夹

What does colon mean in that syntax, "and" ?

冒号在该语法中是什么意思,“和”?

if the path is wrong I'm not sure how to change that in this script, I dont want to change the share/php5to php, or is that recommended?

如果路径错误,我不确定如何在此脚本中更改它,我不想将其更改share/php5php,还是建议这样做?

回答by KingCrunch

What does colon mean in that syntax, "and" ?

冒号在该语法中是什么意思,“和”?

Yes, something like that. Its the path separator and you can compare it with a comma ",".

是的,类似的东西。它是路径分隔符,您可以将其与逗号“,”进行比较。

if the path is wrong I'm not sure how to change that in this script, I dont want to change the share/php5 to php, or is that recommended?

如果路径错误,我不确定如何在此脚本中更改它,我不想将 share/php5 更改为 php,还是建议这样做?

You can change the value in the php.ini. You can find out, which configuration files are used with php --ini. Or you change it withing your script with

您可以更改php.ini. 您可以了解哪些配置文件与php --ini. 或者你用你的脚本改变它

set_include_path(get_include_path() . PATH_SEPARATOR . '/usr/share/php5');

If this is a system-wide behaviour (means: PHP is not working probably at all), you should change it in the configuration. Its just for this one application, then you can use set_include_path().

如果这是系统范围的行为(意味着:PHP 可能根本不工作),您应该在配置中更改它。它仅适用于这个应用程序,然后您可以使用set_include_path().