1.安裝libiconv
tar zxvf libiconv-1.13.1.tar.gz
cd libiconv-1.13.1
./configure -prefix=/usr/local/libiconv
make
make install
2.libmcrypt安裝
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure -prefix=/usr/local
make
make install
4.gd 安裝(對的支援,如驗證碼等)
而安裝 gd 前需要安裝 jpeg-6b, libpng, zlib, freetype。
(1)安裝
zlib
#不要用-prefix指定安裝目錄會影響gd
**:tar zxvf zlib-1.2.3.tar
cd zlib-1.2.3
./configure #或者 cflags="-o3 -fpic" ./configure #如果64位處理器需要 cflags="-o3 -fpic"
make
make install
(2)安裝 freetype
**:tar zxvf freetype-2.1.10.tar.gz
cd freetype-2.1.10
./configure -prefix=/usr/local/freetype
make
make install
(3)安裝 libpng
#不要用-prefix指定安裝目錄會影響gd
**:tar zxvf libpng-1.6.15.tar.gz
cd libpng-1.6.15
./configure
make
make install
(4)安裝 jpeg-7
**:tar zxvf jpegsrc.7.tar.gz
cd jpeg-7
./configure -prefix=/usr/local/jpeg --enable-shared --enable-static
make
make install
(5)安裝 gd
**:tar zxvf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure -prefix=/usr/local/gd -with-jpeg=/usr/local/jpeg -with-png -with-zlib -with-freetype=/usr/local/freetype
make
make install
4.到 php原始碼目錄
./configure --prefix=/usr/local/php --with-apxs2=/usr/sbin/apxs --with-mysql --with-openssl --with-iconv=/usr/local/libiconv --with-bz2 --with-mcrypt=/usr/local --enable-soap --enable-sockets --enable-mbstring=all --enable-bcmath --enable-ftp -with-gd=/usr/local/gd -with-jpeg-dir=/usr/local/jpeg -with-zlib -with-png -with-freetype-dir=/usr/local/freetype
其中 --with-apxs2=/usr/sbin/apxs 跟apache的apxs目錄,我的在/usr/sbin/apxs
make
make install
5.檢查apache配置檔案httpd.config會有
在 directoryindex index.html index.html.var 後增加 index.php
儲存配置檔案
php原始碼安裝
php原始碼安裝。環境 centos7.6 建立了乙個user1使用者。1.1 php 7.3.7.tar.bz2 1.2 解壓 tar xjvf php 7.3.7.tar.bz2 home user1 study softpackage php 7.3.7 2 安裝gcc,autoconf 2....
CentOS原始碼安裝PHP
先安裝需要的庫 yum y install libxml2 yum y install libxml2 devel yum y install gd yum y install gd devel yum y install curl curl devel yum y install libjpeg ...
CentOS 原始碼安裝PHP
2 解壓縮並且進入解壓縮後的檔案目錄下 4 make make install 遇到問題 1 configure error xml2 config not found.please check your libxml2 installation 參看 安裝php時的報錯 checking libx...