みなさん、良い一日を。
通常、* nix OSでこの公式ドキュメントを使用しています
しかし、今は MacO を使用していますが、この手順は正しく機能しません。
pecl install cassandra
このメッセージを受け取った場合:
checking for supported DataStax C/C++ driver version... awk: can't open file /include/cassandra.h
source line number 1
configure: error: not supported. Driver version 2.4.2+ required (found )
ERROR: `/private/tmp/pear/install/cassandra/configure --with-php-config=/usr/bin/php-config' failed
私の論理では、その場合、DataStax C/C++ ドライバーを自分で作成する必要があることがわかります。フォルダー内で、この命令php-driver\lib
を削除cpp-driver
して使用すると、エラーなしで新しくて新鮮な C/C++ ドライバーが作成されます。
したがって、公式ドキュメントでは次のように述べています。
注 install.sh スクリプトは、Apache Cassandra 用の DataStax C/C++ ドライバーのサブモジュール化されたバージョンもコンパイルし、拡張機能に静的にリンクします。システムに既にあるバージョンの cpp ドライバーを使用するには、phpize を実行し、./configure を実行して、make install します。
./configure
しかし、から実行しようとするとphp-drive/ext
、ほぼ同じエラーが発生しました:
checking for supported DataStax C/C++ driver version... awk: can't open file /include/cassandra.h
source line number 1
configure: error: not supported. Driver version 2.4.2+ required (found )
続行しても、そのエラーが実行make install
された後、次のログが表示されます。
/bin/sh /Users/antvirgeo/php-driver/ext/libtool --mode=install cp ./cassandra.la /Users/antvirgeo/php-driver/ext/modules
cp ./.libs/cassandra.so /Users/antvirgeo/php-driver/ext/modules/cassandra.so
cp ./.libs/cassandra.lai /Users/antvirgeo/php-driver/ext/modules/cassandra.la
----------------------------------------------------------------------
Libraries have been installed in:
/Users/antvirgeo/php-driver/ext/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
during execution
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20121212/
cp: /usr/lib/php/extensions/no-debug-non-zts-20121212/#INST@24727#: Operation not permitted
make: *** [install-modules] Error 1
ライブラリは次の場所にインストールされています:
/Users/antvirgeo/php-driver/ext/modules
そのパスで cassandra 拡張機能を php.ini に追加してもClass 'Cassandra\SimpleStatement' not found
、プロジェクトでエラーが発生します。
php -d="extension=modules/cassandra.so" -m
cassandra
PHPモジュールのリストでそれを示しています
私は何を間違っていますか?
PS: このプロジェクトでは、Parallels に ubuntu OS があり、この手順でインストールされた DataStax php ドライバーは正常に動作します。
____upd: エラーのない @Fero のすべての指示の後、コマンドで次のように/usr/local/bin/php -i | grep -A 10 "^cassandra$"
表示されます。
cassandra
Cassandra support => enabled
C/C++ driver version => 2.4.2
Persistent Clusters => 0
Persistent Sessions => 0
Directive => Local Value => Master Value
cassandra.log => cassandra.log => cassandra.log
cassandra.log_level => ERROR => ERROR
それでも同じエラー -Class 'Cassandra\SimpleStatement' not found
______________最終更新:
ああ、それは働いています!私は自分のプロジェクトで出力を書きphpinfo();
、Apache が他の php バージョンを使用していることに気付きphp.ini
ましextension=cassandra.so
た。