【问题标题】:PHP: PEAR Calendar Grid Not Rendering in BrowserPHP:PEAR 日历网格未在浏览器中呈现
【发布时间】:2012-02-15 01:27:45
【问题描述】:

我正在尝试使用 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.*

我发现一篇我认为解决了我的问题的文章 - How to set up PEAR on Mac OS X 10.5 Leopard

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

希望能为您提供足够的信息以提供帮助。

【问题讨论】:

    标签: php calendar pear


    【解决方案1】:

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

    /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 配置,如上所述。

    【讨论】:

    • 我在尝试 sudo /etc/init.d/apache2 reload 时收到命令未找到消息?
    • 好的,我已经设法重新加载 apache2,但我仍然收到原始 q 中所述的错误消息 - "include_path='.:'"
    猜你喜欢
    • 2021-06-20
    • 1970-01-01
    • 2018-02-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多