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. Codeforces Round #287 (Div. 2) C. Guess Your Way Out! 思路

    C. Guess Your Way Out! time limit per test 1 second memory limit per test 256 megabytes input standa ...

  2. nyoj 19擅长排列的小明 (DFS)

    擅长排列的小明 时间限制:1000 ms  |  内存限制:65535 KB 难度:4   描述 小明十分聪明,而且十分擅长排列计算.比如给小明一个数字5,他能立刻给出1-5按字典序的全排列,如果你想 ...

  3. ZOJ-2366 Weird Dissimilarity 动态规划+贪心

    题意:现给定一个字符集中一共Z个元素的环境,给出一个Z*Z的数组,表示从i到j之间的距离.给定两组字符串,分别问包含着两个字符串(给定的字符串为所求字符串的子序列不是子串)对应位的距离和值最小为多少? ...

  4. poj2074Line of Sight(直线相交)

    链接 几何细节题. 对于每一个障碍物可以求出它在地产线上的覆盖区间,如下图. 紫色部分即为每个障碍物所覆盖掉的区间,求出所有的,扫描一遍即可. 几个需要注意的地方:直线可能与地产线没有交点,可视区间可 ...

  5. kvm相关文章

    配置KVM虚拟机的网络 Bridge和Nat方式http://www.it165.net/os/html/201503/12231.html KVM虚拟机网络配置 Bridge方式,NAT方式 htt ...

  6. markdown 语法学习

    markdown是一种轻量级的标记语言,和html类似,但是易读性比html要好很多. 基本语法: 1.标题和正文分隔线 === //至少三个连续等号,最高阶标题 --- //或者三个连续的减号,第二 ...

  7. 检测访问网页的浏览器呈现引擎、平台、Windows操作系统、移动设备和游戏系统

    /** * Author: laixiangran. * Created by laixiangran on 2015/12/02. * 检测访问网页的浏览器呈现引擎.平台.Windows操作系统.移 ...

  8. LinuxShell脚本攻略--第三章 以文件之名

    生成任意大小的文件文件权限.所有权和粘滞位创建不可修改文件生成空白文件查找符号链接及其指向目标head 与 tail只列出目录的其他方法在命令行中用 pushd 和 popd 快速定位(cd -)统计 ...

  9. Linux下数据库的安装和使用

    数据库有多重要就不用说了,每一个计算机相关行业的人都必须要学会基本的数据库操作,因为你总会用到的. 之前转过一些学习资源: 与MySQL的零距离接触 - 慕课网 Python操作MySQL数据库 生物 ...

  10. 谈谈HttpUrlConnection与DefaultHttpClient一些区别

    HttpClient封装的很庞大,很复杂,你必须按照,他封装的思想去使用它,导致它很不灵活. 相比之下,HttpUrlConnection很轻巧,很方便,很灵活. HttpClient对于数据上面的封 ...