编译php-5.4.37支持oracle11g mysql

环境CentOS 6.6 64bit nginx 1.7.9 gcc-4.9.2

step 1

安装oracle client

rpm -ivh oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm

rpm -ivh oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm

echo '/usr/lib/oracle/11.2/client64/lib/' > /etc/ld.so.conf.d/oracle.conf

ldconfig

step 2

编译php

./configure --prefix=/opt/php --with-config-file-path=/opt/php/etc --with-libdir=lib64 --enable-inline-optimization --enable-shared --with-mysql --with-mysqli --with-pdo-mysql --with-gettext --with-openssl --enable-soap --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-readline --with-jpeg-dir --with-iconv --enable-fpm --disable-phar --with-pcre-regex --with-zlib --with-bz2 --enable-calendar --with-curl --enable-dba --with-libxml-dir --enable-ftp --with-gd --enable-gd-native-ttf --enable-gd-jis-conv --with-mhash --enable-mbstring --with-mcrypt --enable-pcntl --enable-xml --disable-rpath --enable-shmop --enable-sockets --enable-zip --enable-mbregex --enable-bcmath --disable-ipv6 --with-oci8=shared,instantclient,/usr/lib/oracle/11.2/client64/lib

make && make install

step 3

配置php.ini

vi /opt/php/etc/php.ini

添加extension=oci8.so

step 4

重启nginx

重启php-fpm

你可能感兴趣的:(oracle,PHP,mysql)