為了省事把所需要的庫檔案全都安裝上,可以使用rpm包安裝,也可以用yum命令安裝,
install安裝freetype
cd
tar jxvf freetype-2.3.10.tar.bz2
cd freetype-2.3.10
./configure --prefix=/usr/local/freetype
make
&&make
install
安裝jpeg
cd
tar zxvf jpegsrc.v7.tar.gz
cd jpeg-7
./configure –prefix=/usr/local/jpeg
make
&&make
install
安裝libpng
cd
tar jxvf libpng-1.2.41.tar.bz2
cd libpng-1.2.41
./configure –prefix=/usr/local/libpng
make
&&make
install
安裝gd
//鏈結標頭檔案
ln -s /usr/local/libpng/include/pngconf.h /usr/include
ln –s /usr/local/libpng/include/png.h /usr/include
//安裝gd
tar zxvf gd-2.0.35.tar.gz
cd gd-2.0.35
./configure –prefix=/usr/local/gd2 \
--with-freetype=/usr/local/freetype –with-png=/usr/local/libpng \
--with-jpeg=/usr/local/jpeg
make
&&make
install
tar jxvf php-5.2.17.tar.bz2
cd php-5.2.17
./configure --prefix=/usr/local/php \
--with-gd=/usr/local/gd2 --with-apxs2=/usr/local/apache/bin/apxs \
--enable-mbregex \
--enable-bcmath \
--with-mysql \
--with-zlib-dir
--enable-mbstring=all \
--with-pdo-mysql \
--with-freetype-dir=/usr/local/freetype
--with-jpeg-dir=/usr/local/jpeg \
--with-openssl \
--with-curl
make
&&make
install
cp php.ini-dist /usr/local/php/lib/php.ini
編輯主配置檔案httpd.conf
//在主配置檔案之間插入行:
<\ifmodule>
//新增apache使用者,修改user和group為:
user apache
group apache
servername localhost:80
include conf.d/*.conf
編寫虛擬目錄:vim /usr/local/apache/conf.d/vhost.conf
namevirtualhost *:80
documentroot /home/linuxops/www/
servername linuxops.com
檢查是否有語法錯誤:/usr/local/apache/bin/apachectl –t
編寫啟動指令碼httpd放在/etc/init.d下
啟動apache:service httpd start
檢查,在預設的apache根文件目錄建立檔案/usr/local/apache/htdocs/test.php,其內容為:
<?
phpinfo()
;?>
輸入:localhost/test.php 檢視php所支援的模組載入情況。
Linux環境編譯安裝Apache PHP
linux環境下的大多數web伺服器都是安裝的apache php,所以將安裝過程詳細記錄如下 一 環境準備 redhat enterprise 6.5 apache 2.4.26 php 7.1.6 二 安裝apache 解壓tar zxf httpd 2.4.26.tar.gz 編譯.confi...
安裝apache php記錄
安裝apache 修改apache配置檔案,可以修改apache的預設埠號,根目錄等 啟動 重啟apache服務 service httpd start或restart 安裝php yum install php 讓apache支援php 修改 etc httpd conf httpd.confs配...
apache PHP編譯安裝精華篇,踩坑總結
1 apache編譯安裝 輔助軟體apr1.6.3 apr util1.6.1 安裝apr 1.63設定目錄許可權為 777bash configure prefix usr local apache apr make make install 可能會提示需要安裝gcc,yum install gc...