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. javascript DOM 常用方法

    前端HTML+CSS+JS流程导图:https://www.processon.com/view/link/5ad1c2d0e4b0b74a6dd64f3c HTML+CSS+Javascript+j ...

  2. 单源最短路——Dijkstara算法

    算法基本思想:每次找到离源点最近的一个顶点,然后以该顶点为中心进行扩展,最终得到源点到其余所有点的最短路径. 1.将所有的顶点分为两个部分:已知最短路程的顶点集合P和未知最短路径的顶点集合Q 2.设置 ...

  3. 调度器的实现、schedule、switch_context、switch_to

    根据<深入Linux内核架构>和Linux-3.10.1内核源码,记一些调度过程的主体工作. 调度器任务:CPU数目比要运行的进程数目少,需要程序之间共享CPU时间,创造并行执行的错觉.分 ...

  4. perl 用网易发邮件报错 554 DT:SPM 163 smtp14

    查看相关链接,貌似被当成垃圾邮件了,发不出去 554 DT:SPM 163 smtp14,EsCowACHUegmKpdc3giRMQ--.29617S2 1553410599,please see ...

  5. 忘记mysql密码时对密码进行更改

    第一步:   打开cmd   输入:net stop mysql 第二步:   再打开另一个cmd    输入:mysqld --skip-grant-tables 第三步:   打开第三个cmd  ...

  6. Android活动和碎片的生命周期及addToBackStack()方法

    开始学了Android活动的生命周期后又到了碎片的生命周期,就开始有点乱了.又看了一些总结的文章有一个挺详细的:https://blog.csdn.net/lecepin/article/detail ...

  7. GIT 私有仓库 github项目提交失败 master -> master (non-fast-forward)

    https://blog.csdn.net/fightingforcv/article/details/52073182 https://blog.csdn.net/u014135752/articl ...

  8. 《温故而知新》JAVA基础八

    集合接口与泛型 定义: 集合接口会操作一系列相同属性数据的对象类型的数据结构,类似于数组,但是相对于数组来说更显得高端大气 集合的接口分为Collention和Map两大类,不直接操作,而是通过子类的 ...

  9. flex属性导图

    声明:部分图片转载自 http://www.ruanyifeng.com/blog/2015/07/flex-grammar.html?utm_source=tuicool

  10. [easyUI] datagrid 数据格 可以进行分页

    1. 新建一个GridNode的类: public class GridNode { private Long id; private String title;//投票标题 private Inte ...