この問題はこれまでに解決されており、解決策を提示しようとしており、何か間違っていると思います。私は、Mountaion Lionを使ってMac上でPHP Codesnifferを設定しようとしています。私はそれが重要だとは思わないが、私はXAMMPを使っている。私はphpcsを実行すると次のエラーが発生します。Codesnifferのinclude_pathが間違っています
Warning: include_once(PHP/CodeSniffer/CLI.php): failed to open stream: No such file or directory in /usr/bin/phpcs on line 31
Warning: include_once(): Failed opening 'PHP/CodeSniffer/CLI.php' for inclusion (include_path='.:') in /usr/bin/phpcs on line 31
Fatal error: Class 'PHP_CodeSniffer_CLI' not found in /usr/bin/phpcs on line 34
このエラーは、すべての検索に基づいて、php.iniのinclude_pathが間違っているために発生します。 私が理解するように、このパスは、梨が存在するディレクトリであると考えられています。私が実行すると、 pear config-get php_dirは/ usr/lib/php/pearを返します。これは右のように見えますが、私は続ける
include_path = ".:/usr/lib/php/pear/"
: は、だから私は、php.iniファイル(このファイルはシステム上の唯一のphp.iniなので、それは別のファイルからの設定をつかんされていない)読むことを修正しました同じエラーが発生します。私は指導者を取り除いた:それは助けにはならない...それはうまくいかない。私はまた、後続の/同じ結果を削除しました。 phpcsはusr/binディレクトリにあります。 以下は梨の設定 - ショー
Configuration (channel pear.php.net):
=====================================
Auto-discover new Channels auto_discover 1
Default Channel default_channel pear.php.net
HTTP Proxy Server Address http_proxy <not set>
PEAR server [DEPRECATED] master_server pear.php.net
Default Channel Mirror preferred_mirror pear.php.net
Remote Configuration File remote_config <not set>
PEAR executables directory bin_dir /usr/bin
PEAR documentation directory doc_dir /usr/lib/php/pear/docs
PHP extension directory ext_dir /usr/lib/php/extensions/no-debug-non-zts-20090626
PEAR directory php_dir /usr/lib/php/pear
PEAR Installer cache directory cache_dir /private/tmp/pear/cache
PEAR configuration file cfg_dir /usr/lib/php/pear/cfg
directory
PEAR data directory data_dir /usr/lib/php/pear/data
PEAR Installer download download_dir /private/tmp/pear/download
directory
PHP CLI/CGI binary php_bin /usr/bin/php
php.ini location php_ini /private/etc/php.ini
--program-prefix passed to php_prefix <not set>
PHP's ./configure
--program-suffix passed to php_suffix <not set>
PHP's ./configure
PEAR Installer temp directory temp_dir /JimS/temp
PEAR test directory test_dir /usr/lib/php/pear/tests
PEAR www files directory www_dir /usr/lib/php/pear/www
Cache TimeToLive cache_ttl 3600
Preferred Package State preferred_state stable
Unix file mask umask 22
Debug Log Level verbose 1
PEAR password (for password <not set>
maintainers)
Signature Handling Program sig_bin /usr/local/bin/gpg
Signature Key Directory sig_keydir /private/etc/pearkeys
Signature Key Id sig_keyid <not set>
Package Signature Type sig_type gpg
PEAR username (for username <not set>
maintainers)
User Configuration File Filename /Users/JimS/.pearrc
System Configuration File Filename /private/etc/pear.conf
任意のアイデアを実行した結果ですか?私はタイプミスを起こしやすいので、常に可能性があるので、私がここに入れるのはカット/ペーストです。
include_pathを変更すると、エラーメッセージが新しいパスを示すように変更されますか?そうでなければ 'php --ini'を実行して、使用しているiniファイル(もしあれば)を調べます。 –
こんにちはグレッグ、返事をありがとう。システムにはphp.iniファイルが1つしかありません。ロードされた設定ファイル:(なし) 追加の.iniファイルをスキャンします。(なし) 追加の.iniファイルが解析されました。(none) ) – user1342600
他のphp.iniがApacheや他のWebサーバーで使用されているか、まったく使用されていない可能性があります。そのphp.iniを/etc/php.iniにコピーしてみてください。これは今から編集するコマンドラインです。一度そこに置かれているかどうかを確認してください。 –