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 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?