继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

Apache整合PHP

波斯汪
关注TA
已关注
手记 364
粉丝 66
获赞 428

前提:已源码安装过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


打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP