PHP 5.6 Compiler installation method in Linux (Support ORACLE/MARIADB database)

Source: Internet
Author: User
Tags fpm ldap zend oracle database

Most phper compile PHP, the pattern is very fixed, simple support for some common extensions to support MySQL is enough, and these phper prefer php5.2 php5.3 Even php5.4 are very few, very reluctant to try to compile a new version, later fixed on this version, with a fixed compiled code. It's safe, though. But we should blaze new trails.

Environment: Linux CentOS 7
PHP Version: PHP 5.6.1
Objective: To support MARIADB (MYSQL), Oracle database expansion and support for common development components

MARIADB,MARIADB is similar to MySQL, not detailed here

Previous paragraph, attempt to compile code successfully (remove Oracle support and remove LDAP support)

The code is as follows Copy Code

./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc--with-config-file-scan-dir=/usr/ LOCAL/PHP/ETC/PHP.D--with-mysql=/usr/local/mysql--with-mysqli=/usr/local/mysql/bin/mysql_config-- With-pdo-mysql--with-iconv--with-freetype-dir--with-jpeg-dir--with-png-dir--with-zlib-- Enable-xml--disable-rpath--enable-bcmath--enable-shmop--enable-sysvsem--enable-inline-optimization--with-curl- -enable-mbregex--enable-fpm--enable-mbstring--with-mcrypt--with-gd--enable-gd-native-ttf-- Enable-pcntl--enable-sockets--with-xmlrpc--with-openssl--enable-soap--enable-zip

Then copy php.ini to the installation directory

Copy the./php-5.6.1/php.ini-production from the compiled directory to/usr/local/php/etc/php.ini

The above compiled configuration code was summed up many times in my attempt to remove some of the compilation configuration (Oracle and LDAP configuration), and it was a long time to discard the Oralce compilation parameters and LDAP compilation parameters in compiling PHP, such as:

The code is as follows Copy Code

--with-oci8=shared,instantclient,/usr/local/lib64/oracle/client/lib--with-pdo-oci=instantclient,/usr/local/ lib64/oracle/client/lib,12.1--enable-opcache--with-ldap--WITH-LDAP-SASL

Where –enable-opcache didn't try

PHP versions of the description:

PHP 5.5 starts to increase the –enable-opcache parameter, meaning to enable the Zend Opcache caching function, similar to the APC cache
PHP 5.4 Removes the parameter –enable-safe-mode–enable-discard-path–enable-fastcgi–enable-force-cgi-redirect

But Oracle, buddy, I want to use, how can you, continue to toss
Perform pecl install oci8 input shared,instantclient,/usr/local/lib64/oracle/client/lib where required
Where/usr/local/lib64/oracle/client/lib is a few Oracle SDK downloads on the website

The code is as follows Copy Code

[root@joe-pc bin]#/usr/local/php/bin/pecl Install Oci8
Downloading oci8-2.0.8.tgz ...
Starting to download oci8-2.0.8.tgz (190,854 bytes)
... done:190,854 bytes--------------------------
source files, Building
Running:phpize
Configuring for:
PHP Api version:20131106
Zend Module Api no:20131226
Zend Extension Api no:220131226
Please provide the path to the Oracle_home directory. Use ' instantclient,/path/to/instant/client/lib ' if your ' re compiling with Oracle instant client [AutoDetect]: Shared,inst Antclient,/usr/local/lib64/oracle/client/lib

Join Oracle Support in PHP configuration file

Edit/usr/local/php/etc/php.d/oracle.ini Content:


Extension=oci8.so

Start PHP-FPM, Mom's error.

notice:php message:php warning:php startup:unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug- Non-zts-20131226/oci8.so '-Libaio.so.1:cannot open Shared object file:no such file or directory in Unknown on line 0

It seems that Oracle still lacks libaio support, but also to install

Yum Install Libaio

Then kill all PHP processes and restart PHP-FPM.


/usr/local/php/sbin/php-fpm

OK, finally done, life is a toss

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.