php编译安装与配置

上传人:油条 文档编号:1719715 上传时间:2017-07-11 格式:DOC 页数:10 大小:76.50KB
返回 下载 相关 举报
php编译安装与配置_第1页
第1页 / 共10页
php编译安装与配置_第2页
第2页 / 共10页
php编译安装与配置_第3页
第3页 / 共10页
php编译安装与配置_第4页
第4页 / 共10页
php编译安装与配置_第5页
第5页 / 共10页
点击查看更多>>
资源描述

《php编译安装与配置》由会员分享,可在线阅读,更多相关《php编译安装与配置(10页珍藏版)》请在金锄头文库上搜索。

1、php 编译安装与配置一:了解与准备1.1:Apache(httpd) nginx 与 php 连接方式:httpd 与 php:1:php 作为 httpd 模块2:fastcgi(php-fpm)3:cgi(此处不讲解)nginx 与 php:1:fastcgi(php-fpm)1.2:PHP 安装与依赖:# yum -y install gcc gcc-c+ libxml2 libxml2-devel bzip2 bzip2-devel libmcrypt libmcrypt-devel openssl openssl-devel libcurl-devel libjpeg-devel

2、libpng-devel freetype-devel readline readline-devel libxslt-devel perl perl-devel psmisc.x86_64 recode recode-devel libtidy libtidy-devel1.3:备注:1:上面的依赖基本解决所需要的依赖。2:编译安装完成后可以增减所支持的 php 模块,此处所编译的模块已经非常完备。3:需要编译单个模块,查看 php 模块编译方式:php 模块编译4:下面编译安装的配置选项:-prefix=/usr/local/php7 主程序文件路径-sysconfdir=/etc/php

3、7 配置文件路径-with-config-file-path=/etc/php7 php.ini 文件路径-with-apxs2=/usr/local/httpd/bin/apxs 以 httpd 模块编译时需要指定 httpd 的 apxs 文件路径。其他的配置可以按自己需求指定,这几个选项也可以使用默认配置。5:php7 移除了 mysql 扩展,php7 仅能是用 mysqli 和 pdo_mysql。php5 可以使用。php5 编译时加入选项:-with-mysql 。详情查看下面的 PHP 与MariaDB(mysql)连接6:此处以 CentOs7 编译 php7 为示例,配合讲

4、解 php5 安装的要点。7:php.ini 文件是在包目录下的 php.ini-development(开发) , php.ini-production(生产)编译完成后选择自己需要的 php.ini 文件 复制到 -with-config-file-path 指定的目录。如果编译时为指定此选项,编译完成配置并启动 nginx 和 php 查看 phpinfo() 函数所指定的 php.ini 文件路径:Configuration File (php.ini) Path默认为 php 目录下的 lib 目录。8:PHP 安装与依赖中 psmisc.x86_64 是 killall 命令的包名

5、,以便最小化安装时终止进程。二:php 编译与配置:2.1: httpd 模块备注:需要事先存在 httpd ,编译指定 apxs 文件位置。此处以-with-apxs2=/usr/local/httpd/bin/apxs 作为演示。php7:# ./configure -prefix=/usr/local/php7 -sysconfdir=/etc/php7 -with-config-file-path=/etc/php7 -with-apxs2=/usr/local/httpd/bin/apxs -with-mysqli=mysqlnd -with-pdo-mysql=mysqlnd -w

6、ith-mhash -with-openssl -with-zlib -with-bz2 -with-curl -with-libxml-dir -with-gd -with-jpeg-dir -with-png-dir -with-zlib -enable-mbstring -with-mcrypt -enable-sockets -with-iconv-dir -with-xsl -enable-zip -with-pcre-dir -with-pear -enable-session -enable-gd-native-ttf -enable-xml -with-freetype-dir

7、 -enable-gd-jis-conv -enable-inline-optimization -enable-shared -enable-bcmath -enable-sysvmsg -enable-sysvsem -enable-sysvshm -enable-mbregex -enable-pcntl -with-xmlrpc -with-gettext -enable-exif -with-readline -with-recode -with-tidyphp5.6:(仅增加了选项 -with-mysql=mysqlnd)# ./configure -prefix=/usr/loc

8、al/php5 -sysconfdir=/etc/php5 -with-config-file-path=/etc/php5 -with-apxs2=/usr/local/httpd/bin/apxs -with-mysql=mysqlnd -with-mysqli=mysqlnd -with-pdo-mysql=mysqlnd -with-mhash -with-openssl -with-zlib -with-bz2 -with-curl -with-libxml-dir -with-gd -with-jpeg-dir -with-png-dir -with-zlib -enable-mb

9、string -with-mcrypt -enable-sockets -with-iconv-dir -with-xsl -enable-zip -with-pcre-dir -with-pear -enable-session -enable-gd-native-ttf -enable-xml -with-freetype-dir -enable-gd-jis-conv -enable-inline-optimization -enable-shared -enable-bcmath -enable-sysvmsg -enable-sysvsem -enable-sysvshm -enab

10、le-mbregex -enable-pcntl -with-xmlrpc -with-gettext -enable-exif -with-readline -with-recode -with-tidy2.2:fastcgi php-fpm 模式php7:# ./configure -prefix=/usr/local/php7 -sysconfdir=/etc/php7 -with-config-file-path=/etc/php7 -enable-fpm -with-mysqli=mysqlnd -with-pdo-mysql=mysqlnd -with-mhash -with-op

11、enssl -with-zlib -with-bz2 -with-curl -with-libxml-dir -with-gd -with-jpeg-dir -with-png-dir -with-zlib -enable-mbstring -with-mcrypt -enable-sockets -with-iconv-dir -with-xsl -enable-zip -with-pcre-dir -with-pear -enable-session -enable-gd-native-ttf -enable-xml -with-freetype-dir -enable-gd-jis-co

12、nv -enable-inline-optimization -enable-shared -enable-bcmath -enable-sysvmsg -enable-sysvsem -enable-sysvshm -enable-mbregex -enable-pcntl -with-xmlrpc -with-gettext -enable-exif -with-readline -with-recode -with-tidyphp5.6:(仅增加了选项 -with-mysql=mysqlnd)# ./configure -prefix=/usr/local/php5 -sysconfdi

13、r=/etc/php5 -with-config-file-path=/etc/php5 -enable-fpm -with-mysql=mysqlnd -with-mysqli=mysqlnd -with-pdo-mysql=mysqlnd -with-mhash -with-openssl -with-zlib -with-bz2 -with-curl -with-libxml-dir -with-gd -with-jpeg-dir -with-png-dir -with-zlib -enable-mbstring -with-mcrypt -enable-sockets -with-ic

14、onv-dir -with-xsl -enable-zip -with-pcre-dir -with-pear -enable-session -enable-gd-native-ttf -enable-xml -with-freetype-dir -enable-gd-jis-conv -enable-inline-optimization -enable-shared -enable-bcmath -enable-sysvmsg -enable-sysvsem -enable-sysvshm -enable-mbregex -enable-pcntl -with-xmlrpc -with-

15、gettext -enable-exif -with-readline -with-recode -with-tidy2.3:php.ini 配置文件(在源码包目录下)# cp php.ini-production /etc/php7/php.ini2.4:php 作为 httpd 模块不需要修改 php 配置,2.5:fastcgi php-fpm# cp /etc/php7/php-fpm.conf.default /etc/php7/php-fpm.conf# cp /etc/php7/php-fpm.d/www.conf.default /etc/php7/php-fpm.d/www.conf# 默认即可是本机 127.0.0.1 不必修改。# vi /etc/php7/php-fpm.d/www.conf# 监听地址listen = 127.0.0.1:9000# 允许的客户端listen.allowed_clients = 127.0.0.1备注:php5 需要复制 php-fpm.conf.default 为 php-fpm.conf 即可。查看 php-fpm.conf 监听地址和允许的客户端。2.6:启动与停止httpd 模块:重新加载 httpd 。fastcgi:# vi /etc/php

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 商业/管理/HR > 其它文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号