国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 系統(tǒng) > Linux > 正文

linux中PHP 5.6編譯安裝方法(支持ORACLE/MARIADB數(shù)據(jù)庫(kù))

2024-08-27 23:59:13
字體:
供稿:網(wǎng)友

PHP 5.6可是一個(gè)最新版本了,它支持了很多以前php不支持的接口如,直接內(nèi)置了ORACLE/MARIADB數(shù)據(jù)庫(kù)了,下面一起來看看PHP 5.6編譯安裝方法.

大多數(shù)phper編譯php的時(shí)候,的模式都很固定,簡(jiǎn)單的支持一些常見拓展 支持mysql就夠了,而且這些phper們偏愛php5.2 php5.3 連php5.4都很少,很不愿意嘗試編譯新的版本,以后就固定用這個(gè)版本,用固定的編譯代碼,這樣雖然很安全,但是我們應(yīng)該開拓創(chuàng)新.

環(huán)境:Linux CentOS 7

PHP版本:php 5.6.1

目的:支持MariaDB(Mysql),Oracle數(shù)據(jù)庫(kù)拓展以及支持常用拓展組件,事先安裝好了MariaDB,MariaDB跟Mysql差不多,此處不詳細(xì)說明,先上段,嘗試成功的編譯代碼,去掉oracle支持 去掉ldap支持,代碼如下:

  1. ./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 --with-libxml-dir=/usr --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 --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --with-openssl --enable-soap --enable-zip 

然后拷貝php.ini到安裝目錄,把編譯的目錄下的 ./php-5.6.1/php.ini-production 拷貝到/usr/local/php/etc/php.ini,上面這段編譯配置代碼是在我嘗試了很多次總結(jié)出來的,一去掉了一些編譯配置(oracle 和 ldap配置),折騰了很久最終還是放棄在編譯php過程中的oralce編譯參數(shù)和ldap編譯參數(shù),代碼如下:

  1. --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  //Vevb.com 

其中–enable-opcache 沒有嘗試.

PHP各版本說明:

PHP 5.5 開始增加 –enable-opcache參數(shù),意思是啟用Zend Opcache緩存功能,類似APC緩存.

PHP 5.4 去掉了參數(shù) –enable-safe-mode –enable-discard-path –enable-fastcgi –enable-force-cgi-redirect

但是Oracle,哥們兒我是要用的,怎么能少了你,繼續(xù)折騰,執(zhí)行 pecl install oci8 在需要錄入的地方輸入 shared,instantclient,/usr/local/lib64/oracle/client/lib

其中 /usr/local/lib64/oracle/client/lib 是在官網(wǎng)下載的幾個(gè)oracle sdk,代碼如下:

  1. [root@joe-pc bin]# /usr/local/php/bin/pecl install oci8 
  2. downloading oci8-2.0.8.tgz ... 
  3. Starting to download oci8-2.0.8.tgz (190,854 bytes) 
  4. .........................................done: 190,854 bytes 
  5. 11 source files, building 
  6. running: phpize 
  7. Configuring for: 
  8. PHP Api Version:         20131106 
  9. Zend Module Api No:      20131226 
  10. Zend Extension Api No:   220131226 
  11. Please provide the path to the ORACLE_HOME directory. Use 'instantclient,/path/to/instant/client/lib' if you're compiling with Oracle Instant Client [autodetect] : shared,instantclient,/usr/local/lib64/oracle/client/lib 

在php配置文件里加入oracle支持,編輯 /usr/local/php/etc/php.d/oracle.ini 內(nèi)容:

extension=oci8.so

啟動(dòng) php-fpm,媽的報(bào)錯(cuò).

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

看來這oracle 還缺少libaio支持,也給裝上:yum install libaio

然后kill掉php所有進(jìn)程,重啟 php-fpm.

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

ok,終于搞定了,生命在于折騰.

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 永州市| 治多县| 江永县| 中江县| 青冈县| 夏津县| 吉木萨尔县| 阜城县| 安化县| 稻城县| 山阳县| 岫岩| 万荣县| 长乐市| 周宁县| 临澧县| 长兴县| 铁岭市| 中卫市| 丹阳市| 乃东县| 长宁区| 双流县| 乳源| 甘德县| 临漳县| 宜丰县| 遂宁市| 石阡县| 青铜峡市| 宜良县| 灯塔市| 锦州市| 慈溪市| 汉源县| 道真| 哈巴河县| 佛学| 嫩江县| 岱山县| 常熟市|