CentOS   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了CentOS.6.6中 PHP-5.5.38安装配置大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

php-5.5.38安装配置     检查并安装相关依赖包 [root@lnmp02 tools]# rpm -qazlib-devel libxml2-devel libjpeg-turbo-devel libiconv-devel [root@lnmp02 tools]# rpm -qafreetype-devel libpng-devel gd-devel libcurl-devel lib

PHP-5.5.38安装配置

  1. 检查并安装相关依赖包

[root@lnmp02 tools]# rpm -qazlib-devel libxml2-devel libjpeg-turbo-devel libiconv-devel

[root@lnmp02 tools]# rpm -qafreetype-devel libpng-devel gd-devel libcurl-devel libxslt libxslt-devel pcrepcre-devel

[root@lnmp02 tools]# yum -yinstall zlib-devel libxml2-devel libjpeg-turbo-devel libiconv-devel

[root@lnmp02 tools]# yum -yinstall freetype-devel libpng-devel gd-devel libcurl-devel libxslt libxslt-develpcre pcre-devel

注意yum源里无libiconv-devel包,需要用源码包单独安装

[root@lnmp02 tools]# wgethttp://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz

[root@lnmp02 tools]# tar zxvflibiconv-1.14.tar.gz

[root@lnmp02 tools]# cdlibiconv-1.14

[root@lnmp02 libiconv-1.14]#./configure --prefix=/usr/local/libiconv

[root@lnmp02 libiconv-1.14]#make

[root@lnmp02 libiconv-1.14]#make install

  1. 安装libmcrypt-devel、@H_573_17@mcrypt、@H_573_17@mhash、@H_573_17@mhash-devel包,由于官方yum源里无此四个包,所以选择epel yum源安装

[root@lnmp02 ~]# wget -O/etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo ###安装epel yum源,此yum源于官方的不冲突,官方找不到需要的包时,才会从epel里找相应的

[root@lnmp02 ~]# yum -y installlibmcrypt-devel mcrypt mhash mhash-devel

  1. 编译安装PHP

[root@lnmp02 PHP-5.5.38]#./configure --prefix=/application/PHP-5.5.38 --with-MysqL=MysqLnd--with-iconv-dir=/usr/local/libiconv --with-freetype-dir --with-png-dir--with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath--enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl--enable-mbregex --enable-fpm --enable-mbString --with-mcrypt --with-gd--enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl--enable-sockets --with-xmlrpc --enable-soap --enable-short-tags--enable-static --with-xsl --with-fpm-user=@L_618_8@ --with-fpm-group=@L_618_8@ --enable-ftp

[root@lnmp02 PHP-5.5.38]# make

===============================================================================

编译过程中报错1

/home/wangning/tools/PHP-5.5.38/sapi/cli/PHP:error while loading shared libraries: libMysqLclient.so.18: cAnnot open sharedobject file: No such file or directory

@H_606_32@make: *** [ext/phar/phar.PHP]Error 127

解决报错1方法

[root@lnmp02 PHP-5.5.38]# ln -s/application/MysqL/lib/libMysqLclient.so.18/usr/lib64/

[root@lnmp02 PHP-5.5.38]# touchext/phar/phar.phar

或者

[root@lnmp02 PHP-5.5.38]# echo"/application/MysqL/lib">>/etc/ld.so.conf

[root@lnmp02 PHP-5.5.38]# ldconfig

编译过程中报错2

/usr/bin/ld: cAnnot find -lltdl

collect2: ld returned 1 exitstatus

@H_606_32@make: *** [sapi/fpm/PHP-fpm]Error 1

解决报错2方法

[root@lnmp02 PHP-5.5.38]# yum-y install libtool-ltdl-devel

===============================================================================

[root@lnmp02 PHP-5.5.38]# makeinstall

[root@lnmp02 PHP-5.5.38]# ln -s/application/PHP5.3.27/ /application/PHP

  1. 配置PHP配置文件

[root@lnmp02 PHP-5.5.38]# cpPHP.ini-production /application/PHP/lib/PHP.ini

[root@lnmp02 PHP-5.5.38]# cp/application/PHP/etc/PHP-fpm.conf.default /application/PHP/etc/PHP-fpm.conf

把配置好的PHP-fpm.conf上传/application/PHP/etc目录下

PHP-fpm.conf见附件

[root@lnmp02 etc]# mkdir/app/logs -p ###创建logs目录,PHP-fpm.conf文件里定义的日志路径

[root@lnmp02 etc]#/application/PHP/sbin/PHP-fpm ###启动PHP服务

[root@lnmp02 etc]# ps -ef|grepPHP ###查看PHP进程

[root@lnmp02 etc]# lsof -i:9000 ###通过端口号查看PHP进程是否起来

大佬总结

以上是大佬教程为你收集整理的CentOS.6.6中 PHP-5.5.38安装配置全部内容,希望文章能够帮你解决CentOS.6.6中 PHP-5.5.38安装配置所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。