php全新安装

 

1:下载:libmcrypt-2.5.8.tar.gz (这是为了安装mcrypt) 

http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/

 

解压安装libmcrypt-2.5.8.tar.gz

[root@localhost ~]#tar zxvf libmcrypt-2.5.8.tar.gz

[[email protected]]#./configure --prefix=/usr/local/libmcrip

[[email protected]]#make && make install 

 

2:下载 php-5.4.0.tar.gz

php下载地址:http://www.php.net/downloads/

 

 

3:解压安装php-5.4.0.tar.gz

[root@localhost ~]#tar -zxvf php-5.4.0.tar.gz 

[root@localhost ~]#cd /usr/src/php-5.4.0

 

4:编译php源码

 [root@localhost ~]#./configure --prefix=/usr/local/php5 --enable-mbstring --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mcrypt=/usr/local/libmcrip --with-config-file-path=/usr/local/php

 

5:安装php

 [root@localhost ~]# make && make install

 

6:复制php.ini配置文件

[[email protected]]cp php.ini-production /usr/local/php5/php.ini 

 

6:集成apache

编辑httpd.conf文件,确认或添加支持PHP环境的相关配置行环境的

[root@localhost ~]#vim /usr/local/apache2/conf/httpd.conf

……

LoadModule php5_module modules/libphp5.so

……

AddType application/x-httpd-php .php

……

DirectoryIndex index.php index.html

 

 

 

7:重启apache

/usr/local/apache2/bin/apachectl restart

 

 

 

你可能感兴趣的:(PHP)