[PECL] Cassandra.dsp does not exist.

465 views
Skip to first unread message

Muhammad Ikhsan

unread,
Mar 31, 2016, 12:53:24 AM3/31/16
to DataStax PHP Driver for Apache Cassandra User Mailing List
Hi,
I'm new at Cassandra. I try to run Cassandra and php on my local (windows 10 + xampp). I stuck on php-driver. I have tried to install it using PECL, and it did not work.

the message in my command prompt are:

>131 source files, building
>WARNING: php_bin P:\\xampp\php\.\php.exe appears to have a suffix \.\php.exe, but config variable php_suffix does not match
>ERROR: The DSP cassandra.dsp does not exist

any suggestion?

below are command i used:
>git clone https://github.com/datastax/php-driver.git
>cd php-driver
>pecl install ext/package.xml

from: https://github.com/datastax/php-driver/blob/master/ext/README.md#installing-with-pecl

Thanks

Michael Fero

unread,
Mar 31, 2016, 12:39:50 PM3/31/16
to DataStax PHP Driver for Apache Cassandra User Mailing List
Hello Muhammad,

The PECL installation instructions you referenced are for Linux; Windows has a different set of instructions. If you want to use the PECL DLLs for Windows you can navigate to https://pecl.php.net/package/cassandra and download the appropriate pre-compiled DLL for your PHP version installed. You can also download the DLL for Windows from the DataStax downloads site here http://downloads.datastax.com/php-driver/. NOTE: The DLLs may have variances between PECL and DataStax downloads since PECL maintains their own third party dependency versions (e.g. MPIR, libuv, ...etc).

To install the Windows PHP driver for Cassandra you will need to extract the php_cassandra.dll from the zip file you download into the directory where your php.exe file is located. You will also need to create (or add to) the php.ini file exetension=php_cassandra.dll in order for PHP to properly load the PHP driver.

~Fero

Muhammad Ikhsan

unread,
Mar 31, 2016, 11:16:05 PM3/31/16
to DataStax PHP Driver for Apache Cassandra User Mailing List

Halo Fero,
Thank for your explanation. I have extracted zip file that I have downloaded from datastax web then copied all the file to the php.exe's directory, include php_cassandra.dll. I also did your suggestion about add extension=php_cassandra.dll php.ini.
And when i tried to run php command in cmd, there still the same warning about cassandra.so can't fount (please check my attachments).

and also, i checked directory php/ext, and there is no cassandra.so file. my question is how to make/generate that file?

Thanks

~ikhsan~

cas1.PNG
cas2.PNG
cas3.PNG

Michael Fero

unread,
Apr 1, 2016, 8:41:43 AM4/1/16
to php-dri...@lists.datastax.com
Hello Muhammad,

You will want to remove the `extension=cassandra.so` lines in your php.in; the .so extensions are shared objects in the *nix environment. To ensure that the extension is being properly loaded you can run `php -m | findstr cassandra` and you should get `cassandra` returned indicating that the driver is being loaded properly.

~Fero

Fero



Michael Fero

Software Engineer | michae...@datastax.com


linkedin.png facebook.png twitter.png g+.png



--
You received this message because you are subscribed to the Google Groups "DataStax PHP Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-driver-us...@lists.datastax.com.

Muhammad Ikhsan

unread,
Apr 3, 2016, 10:08:26 PM4/3/16
to php-dri...@lists.datastax.com
Hi Fero,

I did all your suggestions and test it on cmd. But there was no 'cassandra' returned as you said. Then tried to run some code (attached), I got the "Unable to load cassandra extension" as result in my test page. 

Thanks,


~ikhsan

Michael Fero

unread,
Apr 4, 2016, 9:03:08 AM4/4/16
to DataStax PHP Driver for Apache Cassandra User Mailing List
Muhammad,

Looking through the output you supplied in a previous response on this thread it appears that XAMPP expects the extension/modules to be installed in the ext directory (e.g. P:\xampp\php\ext). You will want to check and see if the PHP included in XAMPP is TS (Thread Safety) or NTS (Non-Thread Safety) and also determine the architecture platform PHP was built for by running `php -i | findstr Safety` and `php -i | findstr Architecture`. It also appears that the XAMPP you installed utilizes PHP v5.6 so once you have determined TS/NTS and the architecture you will want to ensure the appropriate PHP Cassandra driver was download and the DLL is placed in the ext directory that XAMPP is expecting.

Here are four shortcuts for the PHP Cassandra driver v1.1.0 for PHP v5.6. You will want to download the appropriate version based on all the factors of your installed PHP version:

x86 (TS) - http://downloads.datastax.com/php-driver/1.1.0/cassandra-php-driver-1.1.0-5.6-ts-vc11-x86.zip
x64 (TS) - http://downloads.datastax.com/php-driver/1.1.0/cassandra-php-driver-1.1.0-5.6-ts-vc11-x64.zip
x86 (NTS) - http://downloads.datastax.com/php-driver/1.1.0/cassandra-php-driver-1.1.0-5.6-nts-vc11-x86.zip
x64 (NTS) - http://downloads.datastax.com/php-driver/1.1.0/cassandra-php-driver-1.1.0-5.6-nts-vc11-x64.zip

~Fero

Muhammad Ikhsan

unread,
Apr 4, 2016, 9:56:55 PM4/4/16
to php-dri...@lists.datastax.com
Hi Fero,

Thanks for the detail instruction. I did all you instruction, I downloaded x86(TS), then  replace my php_cassandra.dll with the new one on xampp\php\ext. But still can't get cassandra extension loaded.

Any suggestion?

Regard,

~Ikhsan


--
You received this message because you are subscribed to a topic in the Google Groups "DataStax PHP Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this topic, visit https://groups.google.com/a/lists.datastax.com/d/topic/php-driver-user/MTQmAwG6H58/unsubscribe.
To unsubscribe from this group and all its topics, send an email to php-driver-us...@lists.datastax.com.



--
Muhammad Ikhsan
+6282 112 7262 02
reader - coder - blogger
blog | twitter | linkedIn
cas1.PNG

Michael Fero

unread,
Apr 5, 2016, 9:09:07 AM4/5/16
to php-dri...@lists.datastax.com
Hello Muhammad,

I setup a Windows 10 machine with the latest XAMPP download that includes PHP v5.6.19 (x86) (TS). After installation I extracted the `php_cassandra.dll` from http://downloads.datastax.com/php-driver/1.1.0/cassandra-php-driver-1.1.0-5.6-ts-vc11-x86.zip and placed it in the xampp\php\ext directory. Once extracted I modified the `php.ini` file located in xampp\php and added the line `extension=php_cassandra.dll` (line 878) into the "Dynamic Extensions" section and placed it in between `extension=php_bz2.dll` and `extension=php_curl.dll` just to keep everything in alphabetical order. Once the extension once extracted and the INI file was updated I launched the shell through the XAMPP control panel and executed `php -m | findstr cassandra` to ensure that the PHP driver extension was being loaded properly.

Is it possible that the command prompt you are opening is pointing to a different PHP installation other than the one that XAMPP installs? You can execute `where php` and it will show you the location of the PHP executable.

~Fero

Screen Shot 2016-04-05 at 9.00.40 AM.png

Muhammad Ikhsan

unread,
Apr 6, 2016, 3:55:08 AM4/6/16
to php-dri...@lists.datastax.com
Hi Fero,

I got it. Reinstall my xampp then did what you suggested before and  problem solved. 
Thank you very much.


~Ikhsan

--
You received this message because you are subscribed to a topic in the Google Groups "DataStax PHP Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this topic, visit https://groups.google.com/a/lists.datastax.com/d/topic/php-driver-user/MTQmAwG6H58/unsubscribe.
To unsubscribe from this group and all its topics, send an email to php-driver-us...@lists.datastax.com.
cas1.PNG
Reply all
Reply to author
Forward
0 new messages