1.在官网下载php安装源文件。版本选择5的最新稳定版。

[root@trial download]# wget http://cn.php.net/distributions/php-5.5.38.tar.gz

2.下载下来的是一个mirror文件,重命名为php-5.5.38.tar.gz,并解压到源文件目录

[root@trial download]# tar -zxvf php-5.5.38.tar.gz -C /usr/local/src/

[root@trial download]# cd /usr/local/src/php-5.5.38/

  1. 编译安装

    [root@trial php-5.5.38]# ./configure --prefix=/usr/local/php5.5.38 --with-mysql=mysqlnd --enable-mysqlnd --with-gd --enable-gd-native-ttf --enable-gd-jis-conv --enable-fpm

    [root@trial php-5.5.38]# make

    [root@trial php-5.5.38]# make install

  2. 配置

    [root@trial php-5.5.38]# cd /usr/local/php5.5.38/

    [root@trial php5.5.38]# cp etc/php-fpm.conf.default etc/php-fpm.conf

    [root@trial php5.5.38]# vim /usr/local/nginx1.6.3/conf/nginx.conf

     location ~ \.php$ {
    root html;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
    }

此段取消注释,然后红色字体部分修改为$document_root

  1. 启动

    [root@trial php]# sbin/php-fpm

6.验证

[root@trial php5.5.38]# netstat -nltup |grep 9000 #若有抓到9000端口,说明php起来了。

[root@trial html]# echo '' > phpinfo.php

访问到php信息页,说明php配置好了

QA:

configure时报错误

configure: error: xml2-config not found. Please check your libxml2 installation.

检查libxml2已经安装,但是libxml2-devel未安装。

解决

[root@trial php-5.5.38]# yum -y install libxml2-devel.i686

configure时报错误:

configure: error: png.h not found.

解决:

[root@trial php-5.5.38]# yum -y install libpng libpng-devel

php源代码安装的更多相关文章

  1. Linux程序包管理之yum及源代码安装

    第十六章.Linux程序包管理之yum及源代码安装 目录 yum介绍 yum配置文件 yum的repo配置文件中可用的变量 yum命令的使用 使用光盘作为本地yum仓库 如何创建yum仓库 编译安装的 ...

  2. ODOO 源代码安装要求

    ODOO 源代码安装要求 ref:http://www.odoo.com/documentation/10.0/setup/install.html#setup-install-source pyth ...

  3. 源代码安装 MySQL 5.6.28

    本文内容 创建 MySQL 用户和组 解压 MySQL 源代码包 生成配置安装文件 编译和安装 MySQL 配置文件 创建 MySQL 授权表 MySQL 目录授权 启动 MySQL 验证 MySQL ...

  4. Building nginx from Sources(从源代码安装nginx)

    Building nginx from Sources(从源代码安装nginx) The build is configured using the configure command.  安装用配置 ...

  5. 【转载】绝对干货!Linux小白最佳实践:《超容易的Linux系统管理入门书》(连载九)如何通过源代码安装软件

    除了使用Linux的包管理机制进行软件的安装.更新和卸载,从源代码进行软件的安装也是非常常见的,开源软件提供了源代码包,开发者可以方便的通过源代码进行安装.从源码安装软件一般经过软件配置.编译软件.执 ...

  6. 源代码安装GIT

    参考URL:http://blog.chinaunix.net/xmlrpc.php?r=blog/article&uid=25150840&id=4250659 若是条件允许,从源代 ...

  7. 源代码安装软件-MySQL

    一.源码安装 1.经典的源代码安装三步曲: 1.编译前的配置 ./configure 2.编译 make 3.安装 make install 2.源代码软件安装步骤: 1.下载软件包 2.校验软件包 ...

  8. configure - 源代码安装的第一步

    configure是源代码安装的第一步,主要的作用是对即将安装的软件进行配置,检查当前的环境是否满足要安装软件的依赖关系 configure有许多参数可配,具体参见./configure --help ...

  9. Linux 中如何用源代码安装软件,以及如何卸载它

    https://www.linuxidc.com/Linux/2017-12/149839.htm http://www.openssh.com/ http://www.openssh.com/por ...

  10. CentOS7 下源代码安装apache2.4

    Apache httpd 2.4 源代码安装   https://httpd.apache.org/docs/2.4/install.html   这里选用Apache2.4版本. wget http ...

随机推荐

  1. java 知识点

    1. java泛型 避免编译错误 (ArrayList定义时候)    避免强制类型装换 2 多态的体现 实现多态主要有以下三种方式:1. 接口实现 2. 继承父类重写方法 3. 同一类中进行方法重载 ...

  2. js 计算后样式封装

    function getStyle(obj,attr){ // 需要获取的元素 属性 if(obj.currentStyle){ return obj.currentStyle[attr]; }els ...

  3. 0.1:Why are We Addicted to Games

    文章著作权归作者所有.转载请联系作者,并在文中注明出处,给出原文链接. 本系列原更新于作者的github博客,这里给出链接. 前言 本系列仅用于记录并分享自己的学习过程,以及学习过程中遇到的问题,如有 ...

  4. img 兼容问题 css图片与图片之间总是会存在缝隙

    解决方案: 法宝一:定义图片img标签vertical-align:bottom,vertical-align:middle,vertical-align:top. img{vertical-alig ...

  5. 用python画小王八裤(turtle库)

    一,采用Python语言如何画一朵玫瑰花 工具/原料 Python语言包 Win10 一. 准备 1. 打开界面: 打开python 2. 创建文件 二. 编程 1. 编写画图: from turtl ...

  6. [pytorch修改]npyio.py 实现在标签中使用两种delimiter分割文件的行

    from __future__ import division, absolute_import, print_function import io import sys import os impo ...

  7. 马上AI全球挑战者大赛-违约用户风险预测

    方案概述 近年来,互联网金融已经是当今社会上的一个金融发展趋势.在金融领域,无论是投资理财还是借贷放款,风险控制永远是业务的核心基础.对于消费金融来说,其主要服务对象的特点是:额度小.人群大.周期短, ...

  8. Android 按钮响应事件的几种方式

    目录 1.在布局中指定onClick属性 2.使用匿名内部类 3.在当前Activity中实现OnClickListener接口 4.创建内部类 1.在布局中指定onClick属性 布局代码 < ...

  9. xml.libxml2_添加带tagname的xml文本(xmlNewTextChild)

    1. 2.例子代码: int TgText::NodeNew_G2SVG(xmlNode* _pNodeCurrent_G, xmlNode* _pNodeParent_SVG, xmlNode** ...

  10. Python 运行uiKLine.py ,PyQt4错误

    python 开发环境tool: 在运行项目中出现 NO module name PyQt4 错误 解决: