dsp1836 2011-02-23 03:40
浏览 78
已采纳

我的include_path OSX 10.6.6 + PHP 5.3.3 + PEAR可能存在问题

Ok, I think before I start I should just say that I'm a complete n00b when it comes to topic of OSX/BSD. I've only had my MBP for the past week or so and have been learning HEAPS. Though, despite this, I'm still trying to wrap my head around a few things, so, please, be gentle. :)

Alright, on to my problem. I've been trying to setup my local development environment now for a few days. I have activated Apache 2.2 and PHP 5.3.3 which came with the OS. I have also manually installed MySQL, Homebrew and setup BIND (for easier vhost management). Everything appeared to be working quite well until I realize I had to also install PEAR.

Unfortunately, a lot of critical areas within my company's products rely heavily on the PEAR library, so I had to make sure that was all up-and-running before continuing. To install PEAR, I did the following:

  1. $ cd /usr/local/
  2. $ curl http://pear.php.net/go-pear | sudo php
  3. $ php -q go-pear.php
  4. Go through the PEAR install instructions
  5. $ mate ~/.bash_profile
  6. Added /usr/local/bin to my $PATH variable
  7. Saved and closed TextMate
  8. $ which pear (verified the location of PEAR executable)
  9. $ php -r "phpinfo();" | grep '.ini' (to verify locate of current php.ini)
  10. $ mate /etc/php.ini
  11. Changed 'include_path' setting to: ".:/usr/local/PEAR"
  12. Saved and closed TextMate
  13. $ sudo apachectl restart
  14. Happy with the results, I begin installing a few essential PEAR packages (HTTP, NET, etc..)

I then finish checking out the latest revision of one of our SVN repositories and install the app. I attempt to access it via the browser and get an error to the following effect:

 Warning: require_once(HTTP/Request2.php): failed to open stream: No such file or directory in /Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/apps/Mpx/Poller.class.php on line 8

Call Stack:
    0.0003     651400   1. {main}() /Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/call.php:0
    0.0028     927096   2. RXML_Config::autoload() /Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/config/autoload.php:0
    0.0040    1144272   3. require_once('/Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/apps/Mpx/Poller.class.php') /Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/config/autoload.php:18


Fatal error: require_once(): Failed opening required 'HTTP/Request2.php' (include_path='.:/usr/local/PEAR;/Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/Library/Pear/') in /Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/apps/Mpx/Poller.class.php on line 8

Call Stack:
    0.0003     651400   1. {main}() /Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/call.php:0
    0.0028     927096   2. RXML_Config::autoload() /Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/config/autoload.php:0
    0.0040    1144272   3. require_once('/Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/apps/Mpx/Poller.class.php') /Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/config/autoload.php:18

I can verify the location of these files. They DO exist and are in the proper directory. My understanding is that with the 'include_path' of '.:/usr/local/PEAR' PHP first looks in the same directory as the calling script, if nothing is found, it moves to the next path in the list. In the last case, it SHOULD be /usr/local/PEAR, but it comes up with nothing.

The only odd thing I can see from the error report is the following bit in the second section:

(include_path='.:/usr/local/PEAR;/Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/Library/Pear/')

After '.:/usr/local/PEAR' there is a semi-colon and another (valid) path is appended to it. I'm not worried about this particular path, but I'm concerned the semi-colon is causing PHP to think everything after the first colon is a single path. If that's the case, it would make sense that PHP can't find the PEAR libraries.

Given what I've mentioned, could anyone else think of any reason or provide any insight into this matter? Thanks HEAPS!

EDIT:

Alright, this has been resolved. I did executed the following command in the terminal:

$ grep -r -i ini_set("include_path {path/to/project}

Aaaand I found the following:

ini_set("include_path", ini_get("include_path") . ";" . __CONFIG_PATH_LIBRARY_PEAR);

Replacing the ";" with PATH_SEPARATOR fixed the problem nicely.

Thanks go out to Jacob! :)

  • 写回答

1条回答 默认 最新

  • douwen1929 2011-02-23 03:44
    关注

    Search your project for set_include_path or public/Library/Pear/

    It appears like you may be adding to the include path somewhere, and used a semi-colon instead of the PHP constant PATH_SEPARATOR, which will give you the correct separator for your OS.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 为什么apriori的运行时间会比fp growth的运行时间短呢
  • ¥15 帮我解决一下膳食平衡的线性规划模型的数据实例
  • ¥40 万年历缺少农历,需要和阳历同时显示
  • ¥250 雷电模拟器内存穿透、寻基址和特征码的教学
  • ¥200 比特币ord程序wallet_constructor.rs文件支持一次性铸造1000个代币,并将它们分配到40个UTXO上(每个UTXO上分配25个代币),并设置找零地址
  • ¥15 关于Java的学习问题
  • ¥15 如何使用chatgpt完成文本分类任务?
  • ¥15 已知速度v关于位置s的等式,怎么转化为已知位置求速度v的等式
  • ¥15 我有个餐饮系统,用wampserver把环境配置好了,但是后端的网页却进去,是为什么,能不能帮远程一下?
  • ¥15 R运行没有名称为"species"的插槽对于此对象类"SDMmodelCV"