0

我正在尝试使用 PEAR 和 PHP 创建一个网格日历,但是当我在浏览器中预览文件时,我得到以下信息:

*Warning: include(Calendar/Month/Weekdays.php) [function.include]:
   failed to open stream: No such file or directory
   in /Users/x/Sites/p/testing pages/Pear_Date.php on line 8
Warning: include() [function.include]: Failed opening 'Calendar/Month/Weekdays.php'
   for inclusion (include_path='.:') in /Users/x/Sites/p/testing pages/Pear_Date.php
   on line 8
Fatal error: Class 'Calendar_Month_Weekdays' not found
    in /Users/x/Sites/p/testing pages/Pear_Date.php on line 10*

我以为我之前已经解决了这个问题。PEAR 的安装日志指出:

*Current include path : .:
Configured directory : /Users/x/PEAR
Currently used php.ini (guess) : 
Press Enter to continue: 
The 'pear' command is now at your service at /Users/x/bin/pear
** The 'pear' command is not currently in your PATH, so you need to
** use '/Users/x/bin/pear' until you have added
** '/Users/x/bin' to your PATH environment variable.*

我发现一篇我认为解决了我的问题的文章 -如何在 Mac OS X 10.5 Leopard 上设置 PEAR

所以我在我的 php.ini 文件中编辑了 include_path 行,所以它显示include_path = ".:/php/includes:/Users/x/bin/pear" 我还更新了我的.bash_profile文档,所以它export PATH=/Users/x/bin:$PATH像文章所说的那样声明

希望能给你足够的信息来帮助。

4

1 回答 1

1

您的 include_path 是 - 正如 PHP 告诉您的那样 - include_path='.:',即只有当前路径。您需要通过重新加载 apache 配置(在 linux 中作为 root / 使用 sudo,我不了解 OS X)

/etc/init.d/apache2 reload

如果这仍然不能解决问题,那么重新启动 Apache(为了安全起见),然后确保 include_path 没有被注释(通过行首的分号),然后重复。

[编辑:]

如果 php.ini 中的行是注释,则 apache 不会解析它。

您的线路是(正确):

include_path = ".:/php/includes:/Users/x/bin/pear"

或类似的评论:

;include_path = ".:/php/includes:/Users/x/bin/pear"

如果您需要编辑 php.ini,那么您将不得不重新加载 apache 配置,如上所述。

于 2009-07-29T11:34:46.930 回答