編譯安裝PHP遇到的問題

2022-05-26 12:00:12 字數 1611 閱讀 8897

今天公升級了伺服器的mysql到5.5,是通過rpm安裝,公升級之後發現專案中php報錯,於是打算將php也公升級下。

./configure \

--prefix=/usr/local/php \

--with-config-file-path=/usr/local/php/etc \

--with-mysql=/usr/ \

--with-mysqli=/usr/bin/mysql_config \

--with-mysql-sock=/tmp/mysql.sock \

--enable-fpm \

--enable-sockets \

--enable-ftp \

--enable-mbstring \

--enable-zip \

--enable-exif \

--enable-soap \

--enable-gd-native-ttf \

--enable-mbregex \

--disable-ipv6 \

--with-fpm-user=www \

--with-fpm-group=www \

--with-libxml-dir \

--with-mhash \

--with-gd \

--with-jpeg-dir \

--with-png-dir \

--with-freetype-dir \

--with-zlib-dir \

--with-mcrypt \

--with-pear \

--with-curl \

--with-openssl  \

--with-iconv-dir \

--enable-pcntl \

--disable-fileinfo

因為mysql是rpm安裝的,所以在安裝的時候遇到了幾個問題:

configure: error: cannot find mysql header files under /usr/bin/.

note that the mysql client library is not bundled anymore!

首先是報這個錯誤,全域性搜尋了下發現確實沒有mysql.h這個標頭檔案,google後發現應該安裝mysql-devel-5.5.44-1.rhel5.x86_64.rpm這個開發包,

安裝mysql devel包之後重新編譯還是報錯

configure: error: cannot find libmysqlclient under /usr.

find / -name libmysqlclient* 發現這個檔案存在於/usr/lib64/mysql/這個目錄下,而php編譯的時候預設去/usr/lib下查詢,於是

mkdir -p /usr/lib/mysql

cp -r /usr/lib64/mysql/*

/usr/lib/mysql/

再次編譯後通過了.

但是在make 的過程中,因為我們的測試機器記憶體只有512m,很不幸的再次報錯。

google後在這裡找到了答案

再次編譯,make 通過

php編譯安裝以及遇到的問題

關於linux安裝php編譯的一些問題解決,原作者部落格很好 安裝完mysql以及一些擴充套件庫後,方可開始安裝php。安裝php依賴庫 寫道 yum install y gcc gcc c make zlib zlib devel pcre pcre devel libjpeg libjpeg d...

PHP編譯遇到的問題

編譯php的時候遇到的問題 編譯 報錯資訊 configure error please reinstall the libcurl distribution easy.h should be in include curl 解決辦法 yum install curl devel 再次編譯報錯 co...

PHP編譯遇到的問題

編譯php的時候遇到的問題 編譯 報錯資訊 configure error please reinstall the libcurl distribution easy.h should be in include curl 解決辦法 yum install curl devel 再次編譯報錯 co...