CentOS.6.6中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 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
-
安裝libmcrypt-devel、mcrypt、mhash、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
-
編譯安裝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=nginx –with-fpm-group=nginx –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
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
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
-
配置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中mysql的安裝與配置CentOSMySql
- ubuntu中ANT的安裝和配置Ubuntu
- activiti在eclipse中的安裝配置Eclipse
- 在CentOS 6.3中安裝與配置cmakeCentOS
- 本地windows搭建spark環境,安裝與詳細配置(jdk安裝與配置,scala安裝與配置,hadoop安裝與配置,spark安裝與配置)WindowsSparkJDKHadoop
- VMware 中解除安裝安裝Ubuntu 20.04.1 ——Ubuntu系統配置(一)Ubuntu
- zabbix安裝—–nginx安裝和配置Nginx
- Centos6.2中mysql的安裝與配置CentOSMySql
- 在CentOS中安裝與配置SVN的方法CentOS
- Zookeeper 安裝配置
- 【mongodb安裝配置】MongoDB
- ceph安裝配置
- ELK 安裝配置
- Prometheus安裝配置Prometheus
- MySQL安裝配置MySql
- SwitchOmega 安裝配置
- Hive安裝配置Hive
- JWT安裝配置JWT
- oracle安裝配置Oracle
- VNC安裝配置VNC
- rlwrap 安裝配置
- otrs安裝配置
- Sybase安裝配置
- memcache安裝配置
- mfs安裝配置
- storm安裝配置ORM
- Mysql 安裝 配置MySql
- memcached 安裝配置
- Mycat 安裝配置
- ANT安裝、配置
- rcp 安裝配置
- alertmanager安裝配置
- centos7 (阿里雲、linux) 單機spark的安裝與配置詳解(jdk安裝與配置,scala安裝與配置,hadoop安裝與配置,spark安裝與配置)CentOS阿里LinuxSparkJDKHadoop
- MYSQL + MHA +keepalive + VIP安裝配置(一)--MYSQL安裝配置MySql
- postgresql安裝過程中核心資源的配置SQL
- 安裝maven,並將其配置到idea中MavenIdea
- VirtualBox中安裝Fedora9及其配置
- [轉]RAC 安裝配置過程中的問題