2016-09-06 10 views
1

おはようございます。MacOSのCassandra phpドライバ - クラス 'Cassandra SimpleStatement'が見つかりません。

通常私は* nixのOS

でこのOfficial Docsを使用してしかし、今、私はMacOSのを使用していますし、この命令はちょうど正しく動作しません。

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++ドライバを作る必要があることを教え:私はこのメッセージを得たpecl install cassandraの場合は

。フォルダ php-driver\libの中で cpp-driverを削除し、 this instructionを使用すると、エラーのない新しいC/C++ドライバが作成されます。

だから、公式ドキュメントには書かれています:

Note The install.sh script will also compile and statically link into the extension a submoduled version of the DataStax C/C++ driver for Apache Cassandra. To use a version of cpp driver that you already have on your system, run phpize, ./configure and make install.

しかし、私はphp-drive/extから./configureを実行しようと、私はほぼ同じエラーを得た:私は続けていても

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/#[email protected]#: Operation not permitted 
make: *** [install-modules] Error 1 

Libraries have been installed in:
/Users/antvirgeo/php-driver/ext/modules

パスにphp.iniを追加しても、私のプロジェクトにはまだエラーClass 'Cassandra\SimpleStatement' not foundがあります。 PHPモジュール

のリストでcassandraは、私が間違って何をやっていることを示す

php -d="extension=modules/cassandra.so" -m

PS:この手順でうまく動作するDataStax php driverを使ってこのプロジェクトのParallelsにubuntu OSをインストールしました。

____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

______________UPDATED LAST:

Aaaaandそれは働いている!私は出力phpinfo();を私のプロジェクトに書いて、他のPHPバージョンとphp.iniを使ってApacheを実現しています。ここではextension=cassandra.soではありませんでした。

答えて

4

PHPドライバの依存関係であるDataStax C/C++ドライバをインストールする必要があります。ドライバが正常に構築された後にthese instructionsに続いてmake installを使用すると、PHPドライバを構築するときにこの依存関係が使用可能になります。 PHPドライバbuild instructionsを使用する場合は、pecl install cassandraを実行する前に、GMPおよびPHPのデベロッパーライブラリも利用可能であることを確認する必要があります。

EDIT:

あなたはエルキャピタンを使用しているので、あなたがSystem Integrity Protectionの問題に実行していて、/usrにファイルをコピーするために、それをdisableする必要があります。より良い推奨オプションは、Homebrewを使用してPHPをインストールすることです。希望の場合はMacPortsを使用することもできます。

brew install autoconf cmake libuv gmp openssl pcre homebrew/php/php55 
brew link homebrew/php/php55 
mkdir code 
pushd code 
git clone https://github.com/datastax/php-driver.git 
pushd php-driver 
git submodule update --init --recursive 
pushd lib/cpp-driver 
mkdir build 
pushd build 
cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl .. 
make -j$(sysctl -n hw.ncpu) 
sudo make install 
popd 
popd 
mkdir build 
pushd ext 
/usr/local/bin/phpize 
popd 
pushd build 
../ext/configure --with-php-config=/usr/local/bin/php-config 
make -j$(sysctl -n hw.ncpu) 
sudo make install 
popd 
popd 
sudo sh -c 'echo "extension=cassandra.so" >> /usr/local/etc/php/5.5/php.ini' 

あなたは、次のコマンドを使用してインストールを確認することができます:

以下は既にインストールXcodeと自作できれいにOSXエルキャピタン画像上にPHPドライバのインストールを再現するために使用されるステップです

/usr/local/bin/php -i | grep -A 10 "^cassandra$" 

注:これはEl Capitanに付属しているデフォルトバージョンであるため、PHP v5.5が上記のように使用されています。 PHP v5.6およびv7.0を代わりに使用することもできます。

+0

既に完了しました... 私がすでに書いているように、 'pecl install cassandra'が組み込みcppドライバで動作しなかった場合、私はこれらの指示を使用し、自分自身でcppドライバを構築します。 。 とにかくそれは動作しません。投稿のエラーを参照してください。 – ANTVirGEO

+0

@ANTVirGEO元の回答を編集して、 'sudo make install '中のコピー操作が失敗した理由を理解し、ソースからビルドするためのステップバイステップ/スクリプト化の指示を与えるのを助けます。 – Fero

+0

まずは、ステップバイステップの説明をいただきありがとうございます。これは非常に役に立ちます! 元々更新された投稿。 SIPをシャットダウンし、すべての手順を完了しても、同じエラーが発生しました。\ – ANTVirGEO

関連する問題