您好,登錄后才能下訂單哦!
前提:已源碼安裝過Apache
1.安裝PHP之前安裝PHP組件 GD 庫
freetype、jpegsrc、libpng、GD2
(1).安裝freetype
tar zxvf freetype-2.3.10.tar.gz
cd freetype-2.3.10
./configure --prefix=/usr/local/freetype
make && make install
(2).安裝jpeg (yum install zlib*)
tar zxvf jpegsrc.v8.tar.gz
cd jpeg-8
./configure --prefix=/usr/local/jpeg
make && make install
(3).安裝libpng
tar zxvf libpng-1.2.41.tar.gz
cd libpng-1.2.41
./configure --prefix=/usr/local/libpng
make && make install
2.安裝GD2
ln -s /usr/local/libpng/include/pngconf.h /usr/include/
ln -s /usr/local/libpng/include/png.h /usr/include/
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
3.安裝PHP (yum install libxml2*)
tar zxvf php-5.2.11.tar.gz
cd php-5.2.11
./configure --prefix=/usr/local/php \
--with-gd=/usr/local/gd2 \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-freetype-dir=/usr/local/freetype \
--enable-mbregex \
--enable-bcmath \
--with-mysql \
--with-zlib-dir \
--enable-mbstring=all \
--with-pdo-mysql
提供配置文件:
cp php.ini-dist /usr/local/php/etc/php.ini
4.修改Apache配置文件
AddType application/x-httpd-php .php
5.檢查Apache配置文件
/usr/local/apache/bin/apachectl-t
6.提供測頁面并測試
cd /usr/local/apache/htdocs
vim test.php
<?
phpinfo();
?>
http:// 192.168.10.1/test.php
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。