centos 7 編譯 php 5.3.28

因爲centos7 自帶的php版本爲5.4的版本,代碼不支持,降級到5.3 一路坎坷。只能以筆記記錄下來。php

下載,編譯。報錯以下:mysql

 configure error : Cannot find libmysqlclient under /usr.

首先從mysql.com 上下載5.5 二進制編譯好的mysql版本。sql

下載後解壓放到/usr/local/mysql shell

繼續編譯,仍是報一樣的錯誤。查找半天,結果發現是–with-libdir=lib64 這個參數惹的禍,去掉進行編譯。沒有任何問題。centos

第二個問題,沒法加載memchae 模塊。只能從新編譯php,下載php模塊到 ext 這個目錄下ui

而後下載autoconf 2.13的版本 進行編譯,原來的版本備份,快捷方式一個到/usr/bin,不然報錯以下:centos7

buildconf: checking installation...
buildconf: autoconf not found.
You need autoconf version 2.13 or newer installed

autoconf 下載地址:spa

http://ftp.gnu.org/gnu/autoconf/

在php 編譯目錄下執行:code

./buildconf --force

執行完成後會看到有--enable-memchae 這個參數。編譯便可經過。server

參考:http://www.serveridol.com/2012/11/02/php-install-configure-error-cannot-find-libmysqlclient-under-usr/

相關文章
相關標籤/搜索