DataStax PHP Drivers for PHP 7.2

881 views
Skip to first unread message

Nathan

unread,
Jun 28, 2018, 5:28:38 PM6/28/18
to DataStax PHP Driver for Apache Cassandra User Mailing List
Hello
I wanted to know what would be required to get the drivers to work with PHP 7.2.

Thanks

Michael Fero

unread,
Jun 29, 2018, 9:58:46 AM6/29/18
to DataStax PHP Driver for Apache Cassandra User Mailing List
Nathan,

The driver should compile with PHP v7.2; however testing has not been performed to ensure that it is completely functional. You can build the driver manually against PHP v7.2 to get the desired extension. If you are trying to build via PECL you will need to apply the following diff:

diff --git a/ext/package.xml b/ext/package.xml
index cbeea5f..f117d13 100644
--- a/ext/package.xml
+++ b/ext/package.xml
@@ -382,7 +382,7 @@ Documentation:
<required>
<php>
<min>5.6.0</min>
- <max>7.1.99</max>
+ <max>7.2.99</max>
</php>
<pearinstaller>
<min>1.4.8</min>

~Fero

Nathan

unread,
Jun 29, 2018, 11:51:28 AM6/29/18
to DataStax PHP Driver for Apache Cassandra User Mailing List

Thanks Michael,
That's some really good info. I will follow your suggestions and build against PHP 7.2.

Regards

Nathan

Vaibhav Mathur

unread,
Apr 11, 2019, 6:09:12 AM4/11/19
to DataStax PHP Driver for Apache Cassandra User Mailing List

Hi Nathan, did building the php-driver from source work for you?

I was able to build the cassandra.so file, but upon enabling it, php started giving the error : "Segmentation fault (core dumped)".

I'm using it on Ubuntu 18.04.

Nathan Gmail

unread,
Apr 11, 2019, 2:16:10 PM4/11/19
to php-dri...@lists.datastax.com
Hello

Yes I was able to build the driver from source and got it to work.

Nathan
> --
> 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.

Vaibhav Mathur

unread,
Apr 12, 2019, 4:06:08 AM4/12/19
to DataStax PHP Driver for Apache Cassandra User Mailing List
What were your system configuration?

Fero

unread,
Apr 12, 2019, 8:00:12 AM4/12/19
to DataStax PHP Driver for Apache Cassandra User Mailing List
Vaibhav,


Is this a stable commit?
I was able to build the cassandra-driver on Ubtuntu 18.04 using php7.2, but upon enabling the module, php gives a segmentation fault.
Any assistance?

Thanks!


This commit is stable; however there is a known issue (PHP-226) with the Windows build that requires further updates to the build automation on that platform only. Have you tried building a debug version of the driver and using GDB to see where the issue lies? Also have you made sure that the driver module loads without issues? To see if the driver is loading OK you can use the following command; php -m | grep cassandra or php -i | grep -A 10 "^cassandra$" for more detailed information.

You can also try the following to debug with GDB:

1. Create a simple PHP application that utilizes the driver (example.php).

<?php

$cluster
= \Cassandra::cluster()->build();
$session = $cluster->connect();

2. Execute the debug build of the driver using GDB:

gdb --args php example.php

From here you should be able to pinpoint where the problem is via the stack trace.

~Fero

Vaibhav Mathur

unread,
Apr 12, 2019, 8:28:10 AM4/12/19
to php-dri...@lists.datastax.com, michae...@datastax.com
Hi Fero

Thanks for replying!

So I'm running this on Ubuntu 18.04 having php 7.2 (since php 7.2 is not officially supported, I thought building from source would help).
The cassandra.so file is generated without giving any errors.
But the module does not get loaded. Upon loading and running php -m , I get the error : "Segmentation fault (core dumped)"
Can I debug this?

--
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/GHfcLsIKDnQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to php-driver-us...@lists.datastax.com.

Vaibhav Mathur

unread,
Apr 12, 2019, 8:47:03 AM4/12/19
to php-dri...@lists.datastax.com, michae...@datastax.com
Enabling the module doesn't give any error. But after it is enabled, running any php command gives the error message.
image.png

Fero

unread,
Apr 12, 2019, 12:03:50 PM4/12/19
to DataStax PHP Driver for Apache Cassandra User Mailing List, michae...@datastax.com
Vaibhav,

Please try GDB so that you can get a stack trace to help you with debugging the problem; you don't need to use the example.php simply gdb --args php -m.

~Fero

Vaibhav Mathur

unread,
Apr 12, 2019, 1:44:09 PM4/12/19
to php-dri...@lists.datastax.com
Yup, I came across that and finally found an error with libuv module installed. Trying to fix the issue now.

Thanks alot for your help!

--

Fero

unread,
Apr 12, 2019, 1:50:37 PM4/12/19
to DataStax PHP Driver for Apache Cassandra User Mailing List
Awesome and happy to help. Installing libuv on Ubuntu 18.04 is pretty straightforward; run sudo apt-get install libuv1-dev and you should be good to go. You may also want to make sure you have all the dependencies installed for the PHP driver.

Good luck.

~Fero

Vaibhav Mathur

unread,
Apr 12, 2019, 1:53:04 PM4/12/19
to php-dri...@lists.datastax.com
Great! Thank you for the heads up! :D
- Vaibhav

--
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.


Download Zomato: iOS · Android

This email is intended only for the person or the entity to whom it is addressed. If you are not the intended recipient, please delete this email and contact the sender.
Reply all
Reply to author
Forward
0 new messages