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.*

問題を解決したと思われる記事を見つけました - How to setup PEAR on Mac OS X 10.5 Leopard

だから私はphp.iniファイルのinclude_path行を編集したので、記事が言ったように書かれているので、ドキュメントinclude_path = ".:/php/includes:/Users/x/bin/pear" も更新しました.bash_profileexport PATH=/Users/x/bin:$PATH

十分な情報が得られることを願っています。

4

1 に答える 1

1

include_pathは、PHPが指示するように、include_path ='.:'、つまり現在のパスのみです。apache configをリロードする必要があります(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 に答える