stbyruby 发表于 2015-8-20 07:37:10

LAMP安装笔记之源码安装php


[*]下载PHP源码: http://php.net/downloads.php(当前最新版本5.6.7)
[*]tar -xf php-xx.tar
[*]cd php-xx
[*]./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql
  查看所有可配置选项: 1.在运行autoconf 命令后在php源代码目录运行./configure --help
  2.参见GNU configure: http://www.airs.com/ian/configure/
  5.   make
  6.   makeinstall
  7.   cpphp.ini 文件: cp php.ini-development/usr/local/lib/php.ini
  8.   编辑 httpd.conf 文件,确保 LoadModules php5_module modules/libphp5.so 可用
  9.   告知apache将特定扩展名的文件解析成php。比如添加.php:
  在 httpd.conf 中添加:<FilesMatch \.php$>
  SetHandler application/x-httpd-php
  </FilesMatch>
  10.重启apache: service httpd -k restart 或 /usr/local/apache2/bin/apachectl -k restart
  
  参考文档:php官方文档http://php.net/manual/zh/install.unix.apache2.php
页: [1]
查看完整版本: LAMP安装笔记之源码安装php