linux安装php

linux安装php,基于之前gd安装的文章,在此配置php集成gd库。

安装步骤:

1、  解压文件

gunzip php-xxx.tar.gz

tar -xvf php-xxx.tar

cd php-xxx

2、  配置,使其支持gd

./configure -prefix=/usr/local/php/php5 -with-config-file-path=/usr/local/lib -with-apxs2=/usr/local/apache/bin/apxs -with-gd=/usr/local/gd -with-freetype-dir=/usr/local/freetype -with-jpeg-dir=/usr/local/jpeg8 -with-png-dir=/usr/local/libpng -with-zlib=/usr/local/zlib -enable-sockets -enable-track-vars

3、  编译:

# make

安装:

# make install

cp php.ini-dist /usr/local/lib/php.ini

4、  phpapache整合

vi /usr/local/apache2/conf/httpd.conf 找到DirectoryIndex改为如下:

DirectoryIndex index.html index.php index.htm index.html.var

找到

AddType application/x-compress .Z

AddType application/x-gzip .gz .tgz

在它后面添加

AddType application/x-httpd-php .php

/usr/local/apache/bin/apachectl restart

5、  测试

vi /usr/local/apache2/htdocs/index.php

添加<?phpinfo();?>

打开浏览器,输入

http://127.0.0.1/index.php

可以看到关于php的信息,证明php安装成功。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值