这里是文章模块栏目内容页
php7.1版本编译安装cassandra.so扩展的步骤


 编译安装 cassandra.so扩展的办法:

 

 在Centos系统上。

 参考项目: https://github.com/datastax/php-driver

 编译安装cassandra 

 https://github.com/datastax/php-driver/blob/master/ext/README.md

 

 安装依赖:

 libuv 

pushd /tmp
wget http://dist.libuv.org/dist/v1.13.1/libuv-v1.13.1.tar.gz
tar xzf libuv-v1.13.1.tar.gz
pushd libuv-v1.13.1
sh autogen.sh
./configure
make install
popd
popd


安装 依赖cpp-driver 

 下载 git 源码 https://github.com/datastax/cpp-driver/archive/refs/tags/2.12.0.tar.gz

tar xvf cpp-driver-2.12.0.tar.gz 
cd cpp-driver-2.12.0
mkdir build
pushd build
cmake ..
make
make install
popd

 编译安装 

 

 这个是 php-driver cassandrs 的驱动。源码 https://codeload.github.com/datastax/php-driver/tar.gz/refs/tags/v1.3.2


 tar xvf php-driver-1.3.2.tar.gz 
 cd php-driver-1.3.2
  pushd ext
/home/php71/php/bin/phpize
popd
mkdir build
pushd build
../ext/configure --with-php-config=/home/php71/php/bin/php-config
make
make install
popd


在执行 ../ext/configure --with-php-config=/home/php71/php/bin/php-config

这步骤保存 /include/cassandra.h 文件找不到

要手动把 cpp-dirver-2.12.0 里面 include 里面的cassandra.h

ln -s /home/kunbei/cpp-driver-2.12.0/include/cassandra.h  /include/cassandra.h 

有报告 找不到,同样按提示创建对应软连接

ln -s /home/kunbei/cpp-driver-2.12.0/include/cassandra.h  /home/kunbei/php-driver-1.3.2/ext/cassandra.h


make install 成功后,在 /home/php71/php/lib/php/extensions/no-debug-non-zts-20160303/里面有 cassandra.so文件

--------------

然后 按照php 的扩展 方式 在 /home/php71/php/conf.d/ 里面添加cassandra.ini 

里面写  extension="cassandra.so"


 如果是在window环境,直接找php 7.1版本对应的cassandra的dll文件======================================

 也可以直接下载 二进制的dll文件或者so文件 ,添加到php的ext目录。

 但是 centos 版本里面只有rpm 安装方式,不适合 php编译安装,所以需要采用编译安装。

 注意一定要下对 和php对应的 vc版本 nts或者ts 以及x86还是x64的,

 可以通过查看php的 phpinfo 信息,获得以上信息,然后进行下载对应的。

 https://downloads.datastax.com/php-driver/windows/cassandra/v1.3.2/

 这个是 php7.1 windows版本里面 nts vc14 x86 的 php_cassandra.dll

 下载下来,加入到php的ext目录,然后修改 php.ini ,增加 extension=php_cassandra.dll

 

  centos

  里面安装 php7.1版本,编译安装步骤 

 详细参考本站 http://www.siyueweb.cn/index.php?c=show&id=263 

Centos7编译安装php7.3 以及 php-fpm.service 配置开机启动

./configure \
--prefix=/home/php71/php \
--with-config-file-path=/home/php71/php/etc \
--with-config-file-scan-dir=/home/php71/php/conf.d \
--enable-fpm \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
--enable-soap \
--with-libxml-dir \
--with-xmlrpc \
--with-openssl \
--with-pcre-regex \
--with-sqlite3 \
--with-zlib \
--enable-bcmath \
--with-iconv \
--with-bz2 \
--enable-calendar \
--with-curl \
--with-cdb \
--enable-dom \
--enable-exif \
--enable-fileinfo \
--enable-filter \
--with-pcre-dir \
--enable-ftp \
--with-gd \
--with-openssl-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib-dir \
--with-freetype-dir \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-gettext \
--with-gmp \
--with-mhash \
--enable-json \
--enable-mbstring \
--enable-mbregex \
--enable-mbregex-backtrack \
--with-libmbfl \
--with-onig \
--enable-pdo \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-zlib-dir \
--with-pdo-sqlite \
--with-readline \
--enable-session \
--enable-shmop \
--enable-simplexml \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--with-libxml-dir \
--with-xsl \
--enable-zip \
--enable-mysqlnd-compression-support \
--with-pear \
--enable-opcache


上一篇:快速在ubuntu18系统安装kairosdb时序数据库

下一篇:没有了