Home  >  Article  >  Backend Development  >  php编译安装要点

php编译安装要点

WBOY
WBOYOriginal
2016-06-20 12:53:29869browse

php版本:

php-5.6.8.tar.bz2

常用参数
--prefix=/usr/local/php #位置
--with-mysql=/usr/local/mysql  #php依赖于mysql
--with-openssl #openssl支持
--with-mysqli=/usr/local/mysql/bin/mysql_config #mysqli另一种php和mysql交互的方式
--with-freetype-dir #自动引用网页上的字体
--with-jpeg-dir #图片压缩格式
--with-png-dir #图片存储格式
--with-zlib #网络上常用的通用格式压缩库
--with-libxml-dir=/usr #libxml扩展标记语言库
--enable-mbstring #支持中文或非一个字节可以表示的语言
--enable-xml
--enable-sockets #支持socket通信
--with-mcrypt  #mcrypt加密扩展
--with-config-file-path=/etc #配置文件路径/etc/php.ini
--with-config-file-scan-dir=/etc/php.d #配置文件路径 /etc/php.d/*.ini
--with-bz2 #压缩格式
--with-apxs2=/usr/local/apache/bin/apxs #以模块方式若以Fastcgi方式改为:--enable-fpm

--enable-maintainer-zts #表示apache以线程的方式工作,即(event/worker模式)

作为apache的模块的方式

1:配置文件

  • cp php.ini-production /etc/php.ini

2:配置文件相关配置

以Fastcgi模式

1:php主配置文件

  • cp php.ini-production /etc/php.ini #会查看fpm的配置文件

以下都相对/usr/local/php目录

2:启动脚本 sapi/f'p'm/init.d.php-fpm直接复制即可

3:fpm配置文件 /etc/php-fpm.conf.default,复制改名为php-fpm.conf到同一路径下即可

     根据需求配置fpm配置文件,并启用pid文件

     启用 php-fpm 

4:httpd配置文件

  • 开启反向代启用以下两个模块

httpd 2.4之后针对Fastcgi的专用模块

  • 开启反向代理:将请求转到其他主机,获得返回结果

ProxyPass:只能代理转换url

ProxyPassMatch:能使用正则表达式


  • 其他设置和模块方式相同


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn