Updated DataStax PHP Drivers for PHP 7.2 and PHP 7.3?

368 views
Skip to first unread message

Chad Bennett

unread,
Oct 12, 2019, 1:48:58 PM10/12/19
to DataStax PHP Driver for Apache Cassandra User Mailing List
I was reviewing the Datastax PHP Driver code at https://github.com/datastax/php-driver and want to confirm that the driver has been updated to work with PHP 7.2 and 7.3 and that the drivers located at https://downloads.datastax.com/php-driver/ are built using the code at above mentioned Github repo.

makes it look like the driver was updated for PHP 7.2 and 7.3 but the compatibility details in the github repo are not updated to reflect that and there haven't been any updates in the official downloads at https://downloads.datastax.com/php-driver/

Thanks for any help you can provide.

Jason Cross

unread,
Oct 14, 2019, 4:44:24 PM10/14/19
to php-dri...@lists.datastax.com
You might want to just compile from source.  We currently do that to make sure we get all the necessary fixes for PHP 7.2.  This is what we use in our Cent OS 7 based Dockerfile that uses the software collections PHP 7.2 from Remi (https://rpms.remirepo.net/).  You should be able to adapt it to your needs:
# Cassandra PHP Driver with submoduled, statically compiled C/C++ driver
RUN cd /tmp && \
    git clone https://github.com/datastax/php-driver.git && \
    cd php-driver && \
    git submodule update --init && \
# force the cpp driver submodule to the latest master so we get a necessary
# build fix
#   the commit missing is: https://github.com/datastax/cpp-driver/commit/0edf3d2eff88d7594ed7dc070f889b1bcacb677f
    git submodule foreach git pull origin master && \
    cd ext && \
# note that this will delete, then create, then use, then delete again:
#   /tmp/php-driver-installation
    scl enable php72 -- bash -c "\
    ./install.sh" && \
    rm -rf /tmp/php-driver && \
    echo "extension=cassandra.so" > /etc/opt/remi/php72/php.d/97-cassandra.ini


Jason
LinkUp.com

--
To unsubscribe from this group and stop receiving emails from it, send an email to php-driver-us...@lists.datastax.com.

vishal melmatti

unread,
Apr 2, 2020, 2:16:09 PM4/2/20
to DataStax PHP Driver for Apache Cassandra User Mailing List

Hi,

These steps doesnt work on Ubuntu 18.04 with php 7.2. I get error "unable to load libcassandra"
To unsubscribe from this group and stop receiving emails from it, send an email to php-dri...@lists.datastax.com.

vishal melmatti

unread,
Apr 3, 2020, 2:34:49 AM4/3/20
to DataStax PHP Driver for Apache Cassandra User Mailing List
    dpkg -i cassandra-cpp-driver_2.15.1-1_amd64.deb


RUN git clone https://github.com/datastax/php-driver.git /usr/src/datastax-php-driver && \
    cd /usr/src/datastax-php-driver && \
    git submodule update --init && \
    git submodule foreach git pull origin master && \
    cd /usr/src/datastax-php-driver/ext && \
    ./install.sh && \
    echo extension=cassandra.so > /etc/php7/conf.d/cassandra.ini   

This is what I am doing in my Dockerfile.  I am getting this error

checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib
checking for PHP extension directory... /usr/lib/php/20170718
checking for PHP installed headers prefix... /usr/include/php/20170718
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 1.0.1 (ok)
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking Enable Cassandra extension... yes, shared
checking for supported PHP version... supported (7.2.24-0ubuntu0.18.04.3)
checking libuv install dir... yes, shared
checking GNU MP install dir... yes, shared
checking for __gmp_version in -lgmp... yes
checking for uv_version in -luv... yes
checking for supported DataStax C/C++ driver version... supported (2.15.1)
checking for cass_cluster_new in -lcassandra... no
configure: error: Unable to load libcassandra
The command '/bin/sh -c git clone https://github.com/datastax/php-driver.git /usr/src/datastax-php-driver &&     cd /usr/src/datastax-php-driver &&     git submodule update --init &&     git submodule foreach git pull origin master &&     cd /usr/src/datastax-php-driver/ext &&     ./install.sh &&     echo extension=cassandra.so > /etc/php7/conf.d/cassandra.ini' returned a non-zero code: 1

Valentijn Scholten

unread,
May 7, 2020, 4:10:40 PM5/7/20
to DataStax PHP Driver for Apache Cassandra User Mailing List
I am following the same steps (on Amazon Linux 2018.3) and am getting the same error: Unable to load libcassandra.

If it is building with a statically linked cpp driver, I think it shouldn't be looking for it outside its own build?

# Cassandra PHP Driver with submoduled, statically compiled C/C++ driver
RUN cd /tmp && \
    cd php-driver && \
    git submodule update --init && \
# force the cpp driver submodule to the latest master so we get a necessary
# build fix
    git submodule foreach git pull origin master && \
    cd ext && \
# note that this will delete, then create, then use, then delete again:
#   /tmp/php-driver-installation
    # scl enable php72 -- bash -c "\
    bash -c "
    ./install.sh" && \
    rm -rf /tmp/php-driver && \
    echo "extension=cassandra.so" > /etc/opt/remi/php72/php.d/97-cassandra.ini


checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking Enable Cassandra extension... yes, shared
checking for supported PHP version... supported (7.2.20)
checking libuv install dir... yes, shared
checking GNU MP install dir... yes, shared
checking for __gmp_version in -lgmp... yes
checking for uv_version in -luv... yes
checking for supported DataStax C/C++ driver version... supported (2.15.1)
checking for cass_cluster_new in -lcassandra... no
configure: error: Unable to load libcassandra

Valentijn Scholten

unread,
May 15, 2020, 9:22:30 AM5/15/20
to DataStax PHP Driver for Apache Cassandra User Mailing List

On Thursday, May 7, 2020 at 10:10:40 PM UTC+2, Valentijn Scholten wrote:
I am following the same steps (on Amazon Linux 2018.3) and am getting the same error: Unable to load libcassandra.

If it is building with a statically linked cpp driver, I think it shouldn't be looking for it outside its own build?

I solved it by using pecl to compile the driver

RUN cd /tmp && \
    cd php-driver && \
    pecl install ext/package.xml
 
Reply all
Reply to author
Forward
0 new messages