2168575 发表于 2017-3-4 06:02:23

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
  #tar zxvf libmcrypt-2.5.8.tar.gz
  #./configure --prefix=/usr/local/libmcrip
  #make && make install 
  2:下载 php-5.4.0.tar.gz
  php下载地址:http://www.php.net/downloads/
  3:解压安装php-5.4.0.tar.gz
  #tar -zxvf php-5.4.0.tar.gz 
  #cd /usr/src/php-5.4.0
  4:编译php源码
  #./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
  # make && make install
  6:复制php.ini配置文件
  cp php.ini-production /usr/local/php5/php.ini 
  6:集成apache
  编辑httpd.conf文件,确认或添加支持PHP环境的相关配置行环境的
  #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
页: [1]
查看完整版本: php全新安装