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. 【数据结构】B-Tree, B+Tree, B*树介绍 转

    [数据结构]B-Tree, B+Tree, B*树介绍 [摘要] 最近在看Mysql的存储引擎中索引的优化,神马是索引,支持啥索引.全是浮云,目前Mysql的MyISAM和InnoDB都支持B-Tre ...

  2. numpy 数组对象

    numpy 数组对象NumPy中的ndarray是一个多维数组对象,该对象由两部分组成:实际的数据,描述这些数据的元数据# eg_v1 import numpy as np a = np.arange ...

  3. hello2 source anaylis

    首先,我们先来看一看这一段的整体代码, 代码如下: @WebServlet("/greeting") public class GreetingServlet extends Ht ...

  4. poj2115 C Looooops(exgcd)

    poj2115 C Looooops 题意: 对于C的for(i=A ; i!=B ;i +=C)循环语句,问在k位存储系统中循环几次才会结束. 若在有限次内结束,则输出循环次数. 否则输出死循环. ...

  5. Docker Kubernetes 健康检查

    Docker Kubernetes 健康检查 提供Probe探测机制,有以下两种类型: livenessProbe:如果检查失败,将杀死容器,然后根据Pod的重启策略来决定是否重启. readines ...

  6. dijkstral改编

    题意:给你包含n个点的连通图,每个点都有一个权值.给定起点和终点.问你起点到终点的最短路条数,并且输出路径最短且权值之和最大的一条路径. 思路:1.如何根据父节点更新子节点.x,y是父子节点.如果从起 ...

  7. tomcat下面web应用发布路径配置 ( 即虚拟目录配置 )

    https://blog.csdn.net/AnQ17/article/details/52122236

  8. bzoj千题计划168:bzoj3513: [MUTC2013]idiots

    http://www.lydsy.com/JudgeOnline/problem.php?id=3513 组成三角形的条件:a+b>c 其中,a<c,b<c 若已知 两条线段之和=i ...

  9. 【问题解决:启动卡死】Eclipse启动卡死的解决办法

    问题描述 Eclipse启动后卡死 问题分析 由于上一次没有正确关闭,导致在启动的时候开始 问题解决 方法1(推荐): 到<workspace>\.metadata\.plugins\or ...

  10. Docker常用命令详解

    docker ps 查看当前正在运行的容器 docker ps -a 查看所有容器的状态 docker start/stop id/name 启动/停止某个容器 docker attach id 进入 ...