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. Python之多进程&异步并行

    由于python的gil,多线程不是cpu密集型最好的选择 多进程可以完全独立的进程环境中运行程序,可以充分的利用多处理器 但是进程本身的隔离带来的数据不共享也是一个问题,而且线程比进程轻量 impo ...

  2. 网页头部meta标签

    <meta http-equiv="content-Type" content="text/html;charset=UTF-8">    //设置 ...

  3. Django框架详细介绍---request对象

    几个重要的函数 1.HttpRequest.get_host() 根据从HTTP_X_FORWARDED_HOST(如果打开 USE_X_FORWARDED_HOST,默认为False和 HTTP_H ...

  4. spring AOP自定义注解方式实现日志管理

    今天继续实现AOP,到这里我个人认为是最灵活,可扩展的方式了,就拿日志管理来说,用Spring AOP 自定义注解形式实现日志管理.废话不多说,直接开始!!! 关于配置我还是的再说一遍. 在appli ...

  5. python基础(四)集合

    [集合特点]  1.天生去重.循环 2 关系测试 -交集,差集,并集,(反向差集,对称差集) list = [1,2,3,4,5,3,6]list_2 =[2,3,5,7,8]list=set(lis ...

  6. Windows安装MySQL5.7.23 zip包

    工欲善必先利其器 # 环境: Win7旗舰版 + MySQL5.7.23 # 用到的命令: mysqld --initialize -- 初识化 mysqld --install -- 添加到Wind ...

  7. haproxy 初识

    官方网站:http://www.haproxy.org 描述 HAProxy的是一个免费的,非常快速和可靠的解决方案,提供 高可用性, 负载均衡和代理对TCP和基于HTTP的应用程序.它特别适用于流量 ...

  8. Netbeans and Remote Host for C/C++ Developing

    Netbeans and Remote Host for C/C++ Developing 很久以来,因为我不适应在 Linux 下使用 Vim, GCC, GDB 开发 C/C++ 程序,所以我一直 ...

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

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

  10. Js — CommonUtil

    一些js脚本的公用方法: 1:字符串根据给定的每行长度换行 2:比较两个时间的大小3:计算两个日期间相差的天数 1.字符串根据给定的每行长度换行 /** *words:原始字符串 *avg:每行字数 ...