设置PHPphp-5.4.4

一、下载PHPphp-5.4.4

[root@aliyun software]# pwd
/software
[root@aliyun software]# wget
http://mirrors.sohu.com/php/php-5.4.44.tar.gz

二、解压php-5.4.44.tar.gz

 

[root@aliyun software]# tar -xzvf php-5.4.44.tar.gz

三、./configure   make   make
install

[root@aliyun php-5.4.44]# pwd
/software/php-5.4.44
[root@aliyun php-5.4.44]# ./configure –prefix=/usr/local/php
–with-apxs2=/usr/local/apache/bin/apxs
–with-config-file-path=/usr/local/php/etc –with-mysql=/usr/local/mysql
–with-mysqli=/usr/local/mysql/bin/mysql_config –with-libxml-dir
–with-gd –with-jpeg-dir –with-png-dir –with-freetype-dir
–with-iconv-dir –with-zlib-dir –with-bz2 –with-openssl –with-mcrypt
–enable-soap –enable-gd-native-ttf –enable-mbstring –enable-sockets
–enable-exif –disable-ipv6 –with-curl –with-openssl –with-zlib-dir
–enable-ftp

make

make install

肆 、源码安装 Apache+PHP 整合

结合 apache+php 环境,修改 httpd.conf 配置文件,然后进入如下语句:

LoadModule php5_module modules/libphp5.so (默许已存在)

AddType application/x-httpd-php .php

DirectoryIndex index.php index.html (把 index.php 加入 index.html 之前)

⑤ 、然后在/usr/local/apache/htdocs
目录下开创 index.php 测试页面,执行如下 命令

cat >>/usr/local/apache/htdocs/index.php < EOF 

再也启航 apache 服务,通过 IP
访问界面如下图,即表示 LAMP 环境搭建成功。

 

相关文章