下载地址http://www.php.net/downloads.php
一、安装php
1. wget 'http://cn.php.net/distributions/php-5.4.8.tar.bz2'
2. tar jxvf php-5.4.8.tar.bz2
3. ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-curl --with-pear --with-gd --with-jpeg-dir --with-png-dir --with-zlib --with-xpm-dir --with-freetype-dir --with-t1lib --with-mcrypt --with-mhash --with-mysql --with-mysqli --with-pdo-mysql --with-openssl --with-xmlrpc --with-xsl --with-gettext --with-fpm-user=jzy --with-fpm-group --enable-fpm --enable-exif --enable-wddx --enable-zip --enable-bcmath --enable-calendar --enable-ftp --enable-mbstring --enable-soap --enable-sockets --enable-shmop --enable-dba --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-pcntl
4.make
5.sudo make install
6.加入环境变量vim /etc/profile
export PHP_HOME=/usr/local/php
export PATH=$PHP_HOME/bin:$PATH
7. source /etc/profile就可以执行php命令
8.添加php.ini
sudo cp php.ini-development /usr/local/php/etc/php.ini
9. 依赖环境安装
(3)yum install gcc
(4)yum install libxml2
(5)yum install libxml2-devel
(6)yum install openssl openssl-devel
(7)yum install bzip2 bzip2-devel
(8)yum install curl curl-devel
(9)yum install libjpeg libjpeg-devel
(10) yum install libpng libpng-devel
(11)yum install freetype-devel
(12)yum install gmp-devel
(13)yum install libXpm-devel
(14)yum install t1lib-devel
(15)rpm -ivh "http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm"
(16)yum install libmcrypt libmcrypt-devel
(17)yum install libxslt libxslt-devel
(18)yum install make