当前位置: 首页 > news >正文

CentOS.6.6中 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-develmcryptmhashmhash-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=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

 

  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进程是否起来

 

 

本文转自 茁壮的小草 51CTO博客,原文链接:http://blog.51cto.com/wn2100/1941570,如需转载请自行联系原作者

相关文章:

  • OpenStack Swift 对象存储管理(六)
  • 阿里、网易、滴滴共十次前端面试碰到的问题
  • 初窥Python wordcloud之环境搭建
  • 决心书
  • Chapter 4. postfix - High-performance mail transport agent
  • unity, ios skin crash
  • 安全测试===8大前端安全问题(上)
  • mysql关闭与删除bin-log日志详解
  • python函数使用参数技巧笔记
  • 理解Kubernetes(1):手工搭建Kubernetes测试环境
  • Centos Linux 7 设置静态IP
  • 搜查令--中期总结
  • 靜態方法上的泛型
  • 二分图染色模板(P1330 封锁阳光大学)
  • 记录CDH5.10一个clients.NetworkClient: Bootstrap broker ip:9092 disconnected问题
  • EOS是什么
  • Eureka 2.0 开源流产,真的对你影响很大吗?
  • git 常用命令
  • idea + plantuml 画流程图
  • javascript 哈希表
  • PHP 程序员也能做的 Java 开发 30分钟使用 netty 轻松打造一个高性能 websocket 服务...
  • React16时代,该用什么姿势写 React ?
  • SpiderData 2019年2月25日 DApp数据排行榜
  • SpringBoot几种定时任务的实现方式
  • 爱情 北京女病人
  • 百度地图API标注+时间轴组件
  • 测试开发系类之接口自动化测试
  • 工作踩坑系列——https访问遇到“已阻止载入混合活动内容”
  • 官方新出的 Kotlin 扩展库 KTX,到底帮你干了什么?
  • 精益 React 学习指南 (Lean React)- 1.5 React 与 DOM
  • 前端每日实战 2018 年 7 月份项目汇总(共 29 个项目)
  • 前端设计模式
  • 赢得Docker挑战最佳实践
  • 走向全栈之MongoDB的使用
  • 7行Python代码的人脸识别
  • # Pytorch 中可以直接调用的Loss Functions总结:
  • #Z0458. 树的中心2
  • (附源码)springboot车辆管理系统 毕业设计 031034
  • (附源码)springboot太原学院贫困生申请管理系统 毕业设计 101517
  • (十五)Flask覆写wsgi_app函数实现自定义中间件
  • (一)【Jmeter】JDK及Jmeter的安装部署及简单配置
  • (原創) 系統分析和系統設計有什麼差別? (OO)
  • (转)visual stdio 书签功能介绍
  • .Net 4.0并行库实用性演练
  • .net core 连接数据库,通过数据库生成Modell
  • .NET:自动将请求参数绑定到ASPX、ASHX和MVC(菜鸟必看)
  • .NET处理HTTP请求
  • @Transactional 竟也能解决分布式事务?
  • [ web基础篇 ] Burp Suite 爆破 Basic 认证密码
  • []常用AT命令解释()
  • [C/C++]数据结构 循环队列
  • [C++] sqlite3_get_table 的使用
  • [NowCoder]牛客OI周赛3
  • [Oh My C++ Diary]#ifndef / #define / #endif 使用详解
  • [one_demo_8]十进制转二进制