1.下载解压

wget http://au1.php.net/get/php-5.5.1.tar.gz/from/ch2.php.net/mirror

tar zxvf php-5.5.1.tar.gz

cd php-5.5.1

2.编译,安装

./configure --prefix=/usr/local/php --exec-prefix=/usr/bin --bindir=/usr/bin --sbindir=/usr/sbin --with-libxml-dir=/usr/lib --enable-zip --with-mysql --with-mysqli=/usr/bin/mysql_config --with-jpeg-dir=/usr/lib --enable-exif --with-gd --enable-soap --enable-sockets --enable-mbstring --with-freetype-dir --enable-mbstring=all --enable-mbregex --with-zlib --with-bz2 --enable-calendar --with-iconv --with-mcrypt=/usr/local/lib --enable-pdo --with-pdo-mysql --with-gettext --with-curl --with-pdo-mysql --with-openssl --with-mysql-sock --enable-gd-native-ttf --enable-fpm

make && make install

3.配置

  3.1:nginx.conf

    user apache apache;
    worker_processes 1;

    error_log /var/log/nginx/error.log warn;
    pid /var/run/nginx.pid;

    events {

      use   epoll; 
      worker_connections 1024;
    }

    http {
      include /etc/nginx/mime.types;
      default_type application/octet-stream;

      log_format main '$remote_addr - $remote_user [$time_local] "$request" '
               '$status $body_bytes_sent "$http_referer" '
               '"$http_user_agent" "$http_x_forwarded_for"';

      access_log /var/log/nginx/access.log main;

      sendfile on;
      #tcp_nopush on;

      keepalive_timeout 65;

      #gzip on;

      include /etc/nginx/conf.d/*.conf;
    }

    3.2 test2.conf 在 /etc/nginx/conf.d目录下

    server {
      listen 80;
      server_name test2.com;

      #charset koi8-r;
      access_log /var/log/nginx/log/test2.com.access.log main;

      location / {
        root /var/www/cdm;
        index index.php index.html index.htm;
      }

      #error_page 404 /404.html;

      # redirect server error pages to the static page /50x.html
      #
      error_page 500 502 503 504 /50x.html;
        location = /50x.html {
        root /usr/share/nginx/html;
      }

      # proxy the PHP scripts to Apache listening on 127.0.0.1:80
      #
      #location ~ \.php$ {
      # proxy_pass http://127.0.0.1;
      #}

      # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
      #
      location ~ \.php$ {
        root /var/www/cdm;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /var/www/cdm$fastcgi_script_name;
        include fastcgi_params;
      }

      # deny access to .htaccess files, if Apache's document root
      # concurs with nginx's one
      #
      #location ~ /\.ht {
        # deny all;
      #}
    }

注:如果提示mysql、libmcrypt或错误,一般是依赖库未安装,或没有正确指定安装位置。

请确认是否安装,如果已经安装,指定具体位置即可

未安装则先安装。

在配置时需要注意权限的设置还有 root 位置的指定,特别是 fastcgi_param SCRIPT_FILENAME /var/www/cdm$fastcgi_script_name; 这一行,SCRIPT_FILENAME 需要指定具体的路径。

这是最基本的配置,并没有做具体的优化。

php 5.5.1 编译安装过程的更多相关文章

  1. 转-httpd 2.4.4 + mysql-5.5.28 + php-5.4.13编译安装过程

    一.编译安装apache 1.解决依赖关系 httpd-2.4.4需要较新版本的apr和apr-util,因此需要事先对其进行升级.升级方式有两种,一种是通过源代码编译安装,一种是直接升级rpm包.这 ...

  2. Mapnik 编译安装过程

    首先总结一下,Linux(windows上没有测试过)上Mapnik的编译与测试就是一部心酸血泪史呀,如果您没有做好思想准备,那就出门左转,看点有意思的去吧,编译这个太煎熬了. 安装PostgreSQ ...

  3. LAMP环境源码编译安装过程

    LAMP环境源码编译安装过程 一.Apache的安装 1.1.apache软件包及依赖包准备 httpd-2.4.29.tar.bz2       apr-1.6.3.tar.gz      apr- ...

  4. mysql5.5编译安装过程(自己总结)

    一,安装过程 //创建mysql安装目录,创建数据存放目录,创建用户和用户组与赋予数据存放目录权限 mkdir -p /usr/local/mysql/ mkdir -p /data/mysql/ g ...

  5. php编译安装过程中遇到问题

    编译安装PHP时遇到的问题 问题1: configure: error: xml2-config not found. Please check your libxml2 installation. ...

  6. LAMP架构编译安装过程详解

    linux Git 安装 1.安装git依赖包 . yum install -y perl-ExtUtils-MakeMaker package . yum install -y tcl build- ...

  7. R 在linux redhat 6.5的编译安装过程

    下载源码包 在http://cran.r-project.org/mirrors.html,选择一个国内镜像下载需要的版本,比如:http://mirror.lzu.edu.cn/CRAN/src/b ...

  8. mtd-utils编译安装过程

    git clone git://git.infradead.org/mtd-utils.git cd mtd-utils apt install -y libssl-dev libzlb libzst ...

  9. 不要着急改代码,先想想--centos 6.8下编译安装tmux

    诸位读者新年好,2017开年第一篇博客,请允许我先问候一下看到这篇博客的诸位.写博客是我2017年定下的目标之一,希望我会坚持下去. 最近打算尝试一下tmux这个神器,于是有了这一篇关于思维方式的Bl ...

随机推荐

  1. 移动应用调试之 Inspect

    移动端开发时,我们常使用chrome自带的模拟器,模拟各种手机设备. 但模拟毕竟是模拟,当开发完毕,使用真机访问页面出现问题时如何调试呢? 下面介绍2种针对android机的调试方法 一.直接使用Ch ...

  2. shell script数组使用函数输出

    #!/bin/bash # array variable to function test function testit { local newarray newarray=("$@&qu ...

  3. UVA 11468【AC自动机+DP】

    dp[i][j]表示走了i步走到j结点的概率.初始值dp[0][0] = 1.当走到的结点不是单词尾结点时,才能走过去. !end[i]&&last[i] == root时,该结点才可 ...

  4. 让你分分钟读懂CPU架构及芯片厂商

    CPU架构是CPU厂商给属于同一系列的CPU产品定的一个规范,主要目的是为了区分 不同类型CPU的重要标示.目前市面上的CPU指令集分类主要分有两大阵营,一个是intel.AMD为首的复杂指令集CPU ...

  5. Android播放视频

    package cn.c;   import java.io.File;   import java.io.IOException;   import android.app.Activity;   ...

  6. android下基本json串的生成与解析

    以前就用过json串,不过是在java环境下面,如今转移到android环境下,java里面生成解析json串的jar包与android中自带的冲突,所以也只能用安卓自带的.   先前查网上的资料,感 ...

  7. go语言中间的循环

    在Go语言中只有很少的几个控制结构,它没有while或者do-while循环. 但是它有for.switch.if.而且switch接受像for那样可选的初始化语句.下面来认识一下他们 一.if语句 ...

  8. eclipse右击打war包class没打上去的问题

    今天,遇到个诡异的问题,一个工程eclipse打war包class就是打不上,别的能打上,发现这样选择tomcat,打包成功,谨此备注.

  9. mysql报关于用户密码1045(28000),几种处理方法 (zhuan)

    http://blog.itpub.net/29371470/viewspace-1409075/ http://blog.csdn.net/rosten/article/details/250658 ...

  10. UEditor 之查询当前编辑区域的状态是源码模式还是可视化模式

    在使用百度的编辑器的时候,遇到了这样的一个问题: 解决方法是 使用了两个命令: