大佬教程收集整理的这篇文章主要介绍了centos 6.5下编译安装php-7.1.6和 php memcached扩展,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
0,安装 PHP-7.1.6 依赖包
#yumgroupinstall"Developmenttools""DesktopPlatformDevelopment" #yum-yinstallopenssl-devellibcurl-devellibmcryptlibmcrypt-develbzip2-devel
1,编译安装PHP 7.1.6
## 如果需要加入 pgsql扩展 ,则必须先安装好 POSTGResql
#wgethttp://cn2.PHP.net/get/PHP-7.1.6.tar.gz/from/this/mirror wgethttp://hk1.PHP.net/get/PHP-7.1.6.tar.gz/from/this/mirror #tarxfPHP-7.1.6.tar.gz #cdPHP-7.1.6 #./configure--prefix=/usr/local/PHP-7.1.6\ --with-config-file-path=/usr/local/PHP-7.1.6/etc --with-MysqLi--with-pdo-MysqL--with-pgsql=/usr/pgsql-9.4/\ --with-pdo-pgsql=/usr/pgsql-9.4/--with-openssl\ --with-zlib--with-bz2--with-gettext--with-curl\ --with-gd--with-mhash--with-xmlrpc--with-mcrypt\ --enable-xml--enable-bcmath--enable-shmop --enable-sysvsem--enable-fpm--enable-mbString\ --enable-pcntl--enable-sockets--enable-soap\ --enable-calendar--enable-dba--enable-exif\ --enable-ftp--with-freetype-dir--with-jpeg-dir--with-png-dir #make&&makeinstall
##在编译好的源码包目录下复制PHP的配置文件 #cp/usr/local/src/PHP-7.1.6/PHP.ini-production/usr/local/PHP-7.1.6/etc/PHP.ini ##复制PHP-fpm配置文件 #cp/usr/local/PHP-7.1.6/etc/PHP-fpm.conf.default/usr/local/PHP-7.1.6/etc/PHP-fpm.conf ##复制www配置文件 #cp/usr/local/PHP-7.1.6/etc/PHP-fpm.d/www.conf.default/usr/local/PHP-7.1.6/etc/PHP-fpm.d/www.conf #vim/usr/local/PHP-7.1.6/etc/PHP-fpm.d/www.conf##修改PHP-fpm模块使用用户和组 user=Nginx group=Nginx ##在编译好的源码包目录下复制PHP-fpm启动脚本到/etc/init.d/ #cp/usr/local/src/PHP-7.1.6/sapi/fpm/init.d.PHP-fpm/etc/init.d/PHP-fpm #chmod755/etc/rc.d/init.d/PHP-fpm #chkconfig--addPHP-fpm #chkconfig--listPHP-fpm #vim/etc/profile.d/PHP.sh##导出命令搜索路径到环境变量 exportPHP_home=/usr/local/PHP-7.1.6/bin/ exportPATH=$PATH:$PHP_home #./etc/profile.d/PHP.sh
2,安装 memcached 缓存扩展
#yuminstallcyrus-saslcyrus-sasl-devel-y##memcached的依赖包 #peclinstallmemcached ##PHP-memcached扩展依赖库 #wgethttps://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz #tarxflibmemcached-1.0.18.tar.gz #cdlibmemcached-1.0.18 #./configure--prefix=/usr/local/libmemcached-1.0.18--with-memcached #make&&makeinstall ##要使用pecl命令的前提是已经编译安装好的PHP中含有pear命令包,不过PHP-7.1.6中默认安装有pear #/usr/local/PHP-7.1.6/bin/peclinstallmemcached
libmemcached directory [no] : 填入刚才libmemcached的编译安装目录地址
##pecl命令安装完memcached后会提示你将memcached.so追加到PHP.ini配置文件中 ##在PHP配置中追加memcached模块 #echo"extension=memcached.so">>/usr/local/PHP-7.1.6/etc/PHP.ini
以上是大佬教程为你收集整理的centos 6.5下编译安装php-7.1.6和 php memcached扩展全部内容,希望文章能够帮你解决centos 6.5下编译安装php-7.1.6和 php memcached扩展所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。