Apache整合PHP

发布时间:2020-03-09 21:52:24 作者:dengaosky
阅读:429
PHP开发者专用服务器,限时0元免费领! 查看>>

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

亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

推荐阅读:
  1. apache与redmine整合-使用passenger
  2. PHP与nginx整合

开发者交流群:

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

php apache he

上一篇:Linux 重定向符:> ,>>, <

下一篇:IP地址的概述与应用

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》
开发者交流群×