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. idea显示左边的树形项目结构

    直接上步骤: File-->Project Structure-->Modules-->点击:中间一列框的"+"-->Import Module--> ...

  2. 使用shiro框架,注销问题的解决

    在使用shiro框架的时候,有时候会因为登录问题找不到注销的controller.所以会报404的错误,下面是解决办法: 1.首先写一个类SystemLogoutFilter继承LogoutFilte ...

  3. WIN10下,JAVA安装及环境变量配置(cmd可以运行java,却不能运行javac)

    1.安装JDK 选择安装目录 安装过程中会出现两次 安装提示 . 第一次是安装 jdk ,第二次是安装 jre .建议两个都安装在同一个java文件夹中的不同文件夹中.(不能都安装在java文件夹的根 ...

  4. POI使用记录

    POI CellType类型 CellType  类型  值 CELL_TYPE_NUMERIC  数值型  0 CELL_TYPE_STRING  字符串型 1 CELL_TYPE_FORMULA ...

  5. Learning-Python【5】:Python数据类型(1)—— 整型、浮点型、字符串

    一.整型 1.用途:记录年龄.等级.各种号码等 2.定义方式 age = 22 只能将纯数字的字符串转换成整型 3.常用操作+内置方法 赋值运算.比较运算.算数运算 该类型总结: 存一个值 不可变(可 ...

  6. Eclispe创建maven工程缺失web.xml报web.xml is missing and <failOnMissingWebXml> is set to true的错误

    Eclispe创建maven工程缺失web.xml报web.xml is missing and <failOnMissingWebXml> is set to true的错误,一看,还缺 ...

  7. [python]上传文件验证

    上传文件验证 上传文件验证分为:1.文件头验证 2.文件类型验证 3.文件后缀验证 获取文件上传的二进制数据 # 获取上传文件 file = request.files.get('file') if ...

  8. centos的防火墙相关

    在服务器上启动了node服务,但是外面访问不到, 原因是防火墙没开端口,新装的机器,也没有iptables systemctl stop firewalld yum install iptables- ...

  9. springboot启动配置原理之三(事件监听机制)

    ApplicationContextInitializer public class HelloApplicationContextInitializer implements Application ...

  10. Openstack官网文档简介

    OpenStack documentation相关文档见 docs.openstack.org. 主要包含这些方面的文档: Installation Guides Deployment Guides ...