Cassandra php driver on MacOS - Class 'Cassandra\SimpleStatement' not found
<p>Good day, everyone.</p>

<p>Usually I just using this <a href="https://github.com/datastax/php-driver/blob/master/ext/README.md" rel="nofollow">Official Docs</a> in *nix OS </p>

<p>But now i'm using MacOs and this instructions just doesn't work properly.</p>

<p>In case of <code>pecl install cassandra</code> I got this message:</p>

<pre><code>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
</code></pre>

<p>My logic tell me that in that case I need make DataStax C/C++ driver by my own. In folder <code>php-driver\lib</code> I deleting <code>cpp-driver</code> and using <a href="http://datastax.github.io/cpp-driver/topics/building/" rel="nofollow">this instruction</a> make new and fresh C/C++ driver without errors.</p>

<p>So in official doc it says: </p>

<blockquote>
  <p>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.</p>
</blockquote>

<p>But when i trying to run <code>./configure</code> from <code>php-drive/ext</code> I got almost the same error:</p>

<pre><code>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 )
</code></pre>

<p>Even if I continue and after that error run <code>make install</code> it gives me that log:</p>

<pre><code>/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
</code></pre>

<blockquote>
  <p>Libraries have been installed in:<br>
  /Users/antvirgeo/php-driver/ext/modules</p>
</blockquote>

<p>Even if I adding cassandra extension with that path to php.ini I still got error <code>Class 'Cassandra\SimpleStatement' not found</code> in my project. </p>

<p><code>php -d="extension=modules/cassandra.so" -m</code> showing that <code>cassandra</code> in list of PHP Modules</p>

<p>What am I doing wrong?</p>

<p><em>PS: I have ubuntu OS in Parallels with this project with DataStax php driver installed with this instructions works fine.</em></p>

<p>____upd:
After all instructions of @Fero without <strong>ANY ERRORS</strong>, command <code>/usr/local/bin/php -i | grep -A 10 "^cassandra$"</code> showing me this:</p>

<pre><code>cassandra

Cassandra support =&gt; enabled
C/C++ driver version =&gt; 2.4.2
Persistent Clusters =&gt; 0
Persistent Sessions =&gt; 0

Directive =&gt; Local Value =&gt; Master Value
cassandra.log =&gt; cassandra.log =&gt; cassandra.log
cassandra.log_level =&gt; ERROR =&gt; ERROR
</code></pre>

<p>And still the same error - <code>Class 'Cassandra\SimpleStatement' not found</code></p>

<p>______________UPDATED LAST:</p>

<p>Aaaaand it's working! I wrote output <code>phpinfo();</code> in my project and realize that apache using other php version and <code>php.ini</code>, where wasn't <code>extension=cassandra.so</code> at all.</p>