http://www.cnblogs.com/wubaiqing/archive/2011/11/08/2241195.html

四,启动php-fpm & Nginx

/usr/local/php/sbin/php-fpm &
#方法1
[root@admin nginx-1.2.6]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

#强制停止
pkill -9 nginx

重启
[root@admin local]# /usr/local/nginx/sbin/nginx -s reload

#方法1
[root@admin nginx-1.2.6]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

http://php.net/downloads.php 官网地址
tar -zxvf php-5.3.6.tar.gz
cd php-5.3.6
./configure --prefix=/usr/local/php --enable-mbstring --with-mcrypt --with-mhash --enable-fpm
./configure --prefix=/usr/local/php --enable-fpm --with-mcrypt \
--enable-mbstring --disable-pdo --with-curl --disable-debug --disable-rpath \
--enable-inline-optimization --with-bz2 --with-zlib --enable-sockets \
--enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex \
--with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli \
--with-gd --with-jpeg-dir

./configure --prefix=/usr/local/php54 --with-config-file-path=/usr/local/php54/lib/ --enable-fpm --with-mcrypt \
--enable-mbstring --enable-pdo --with-curl --disable-debug --disable-rpath \
--enable-inline-optimization --with-bz2 --with-zlib --enable-sockets \
--enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex \
--with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli --with-pdo-mysql \
--with-gd --with-jpeg-dir
------------------------------------------------------------------------------------------------
configure: error: xml2-config not found. Please check your libxml2 installation.
yum install libxml2-devel -y

configure: error: mcrypt.h not found. Please reinstall libmcrypt
rpm -ivh "http://www.lishiming.net/data/attachment/forum/month_1211/epel-release-6-7.noarch.rpm"
yum install -y libmcrypt-devel

configure: error: Please reinstall the BZip2 distribution
yum install bzip2
yum install bzip2-devel

configure: error: Please reinstall the libcurl distribution -
yum -y install curl-devel

configure: error: jpeglib.h not found.
yum install libjpeg-devel libpng-devel
------------------------------------------------------------------------------------------------
make && make install
cp /home/php-5.5.26/php.ini-production /usr/local/php/lib/php.ini
cd /usr/local/php/etc/
cp php-fpm.conf.default php-fpm.conf

make && make install
cp /home/php-5.4.44/php.ini-production /usr/local/php54/lib/php.ini
cd /usr/local/php54/etc/
cp php-fpm.conf.default php-fpm.conf

vim php-fpm.conf
去掉下列变量前面的注释,以避免启动php-fpm时报错
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 500

error_log = log/php-fpm_error.log
log_level = notice
daemonize = yes
user = www
group = www
catch_workers_output = yes

三,整合Nginx和php

编辑Nginx配置文件,其中`/data/nginxwebs`为站点根目录
vim /usr/local/nginx/conf/nginx.conf

location / {
root /data/nginxwebs;
index index.html index.htm index.php;
expires 30m;
}

location ~ /.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /data/nginxwebs$fastcgi_script_name;
include fastcgi_params;
}

添加用户及用户组
useradd www -s /sbin/nologin
groupadd www
usermod -G www www

四,启动php-fpm & Nginx

/usr/local/php/sbin/php-fpm &
/usr/local/nginx/sbin/nginx &

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
/usr/local/php/sbin/php-fpm

#强制停止
pkill -9 nginx

重启
[root@admin local]# /usr/local/nginx/sbin/nginx -s reload

#方法1
[root@admin nginx-1.2.6]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

今天换了电脑,原来电脑里的程序都没了,就下了一个新的帝国备份王,结果备份网站的时候就出现了:Parse error: syntax error, unexpected $end in XX,出现这种情况要怎么办呢,其实很简单:

只要把php.ini文件里的short_open_tag = Off,修改为short_open_tag = On然后重启服务器就OK了。

本篇文章来源于源码库(www.aspku.com),转载请注明出处 原文链接:http://www.aspku.com/cms/diguocms/44130.html

http://www.centoscn.com/image-text/config/2015/0713/5850.html

apache  的

/configure --prefix=/usr/local/php53 \
--enable-mbstring --disable-pdo --with-curl --disable-debug --disable-rpath \
--enable-inline-optimization --with-bz2 --with-zlib --enable-sockets \
--enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex \
--with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli \
--with-gd --with-jpeg-dir --with-apxs2=/usr/local/apache2/bin/apxs

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .php5

php5.5.34

./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs \
--with-config-file-path=/usr/local/php5/etc/php.ini --with-mysql=mysqlnd --with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd --enable-mbstring \
--with-openssl --with-mhash --with-mcrypt --with-gettext --with-zlib-dir=/usr/local/zlib --enable-zip \
--enable-sockets --enable-soap --with-xmlrpc --with-libxml-dir --with-zlib=/usr/local/zlib/ --with-mysql=/usr/local/mysql --with-mcrypt

error: Cannot find libmysqlclient_r under /usr/local/mysql.

看安装了mysql-dev没有  64位32位都装上

configure: error: mysql configure failed. Please check config.log for more information

[vagrant@rs-1 mysql]$ ./configure --with-php-config=/usr/local/bin/php-config --with-mysql-dir=/usr --with-zlib-dir    看清楚是--with-mysql-dir

linux搭建php的更多相关文章

  1. Linux 搭建Nexus

    Linux 安装Maven和nexus代理仓库 1    说明 环境:redhat Enterprise Linux Server5.3-x64. 版本:Maven 3.0.5 ,Nexus-2.5. ...

  2. Linux 搭建SVN 服务器(转)

    一. SVN 简介 Subversion(SVN) 是一个开源的版本控制系統, 也就是说 Subversion 管理着随时间改变的数据. 这些数据放置在一个中央资料档案库 (repository) 中 ...

  3. 原 Linux搭建SVN 服务器2

    原 Linux搭建SVN 服务器 发表于1年前(2014-08-05 17:55)   阅读(12257) | 评论(3) 31人收藏此文章, 我要收藏 赞3 摘要 Linux搭建SVN 服务器 目录 ...

  4. 原 Linux搭建SVN 服务器

    原 Linux搭建SVN 服务器 发表于1年前(2014-08-05 17:55)   阅读(12257) | 评论(3) 31人收藏此文章, 我要收藏 赞3 摘要 Linux搭建SVN 服务器 目录 ...

  5. Linux搭建SVN 服务器

    Linux搭建SVN 服务器 1          安装SVN 2          使用客户端连接 2.1       使用windows的客户端 2.2       使用Linux下的命令行 3  ...

  6. Linux 搭建SVN server

    一. SVN 简单介绍 Subversion(SVN) 是一个开源的版本号控制系統, 也就是说 Subversion 管理着随时间改变的数据. 这些数据放置在一个中央资料档案库 (repository ...

  7. Linux搭建SVN 服务器(转)

    转自:http://my.oschina.net/lionel45/blog/298305 Linux搭建SVN 服务器 作者: 沈小然    日期:2014年 8月 5日 1          安装 ...

  8. Linux 搭建SVN 服务器

    一. SVN 简介 Subversion(SVN) 是一个开源的版本控制系統, 也就是说 Subversion 管理着随时间改变的数据. 这些数据放置在一个中央资料档案库 (repository) 中 ...

  9. linux搭建phantomjs+webdriver+testng+ant自动化工程

    因为项目的原因,需要将脚本在linux环境无浏览器化去跑,那么原有的在windows系统下有浏览器化的自动化脚本场景就不适用了,这里给出linux系统下搭建phantomjs+webdriver+te ...

  10. Linux搭建SVN服务器(服务端)

    Linux搭建SVN服务器(服务端) 1 安装SVN SVN客户端:TortoiseSVN,官网下载:https://tortoisesvn.net/downloads.html(客户端) # yum ...

随机推荐

  1. boost信号量 boost::interprocess::interprocess_semaphore的用法

    使用方法首先给信号量初始化赋值,可以根据需要设定需要的值,之前在写项目的过程中用这个控制下载的线程个数. boost::interprocess::interprocess_semaphore m_s ...

  2. codevs 1922 骑士共存问题 网络流

    题目链接 给一个n*n的棋盘, 上面有障碍物, 有障碍物的不能放东西.然后往上面放马, 马不能互相攻击, 问最多可以放多少个马. 按x+y的奇偶来划分, 如果两个格子可以互相攻击, 就连一条权值为1的 ...

  3. 使用SecureCRT网络连接树莓派

        为了更加方便可以通过网络来连接.控制树莓派,使用SecureCRT可以通过网络来连接树莓派.     1.在树莓派上通过终端命令ifconfig 来查看当前树莓派的IP地址:     IP地址 ...

  4. Ubuntu root登陆

    分两步: 1.激活root 输入命令:sudo passwd,键入当前用户密码之后,为系统设置root密码:交互如下: jack@ubuntu:~$ sudo passwd[sudo] passwor ...

  5. Oracle ORA-01555 快照过旧 说明

    oracle高级知识(1) ORA-01555 快照过旧,是数据库中很常见的一个错误,比如当我们的事务需要使用undo来构建CR块的时候,而此时对应的undo 已经不存在了, 这个时候就会报ORA-0 ...

  6. [置顶] 【cocos2d-x入门实战】微信飞机大战之三:飞机要起飞了

    转载请表明地址:http://blog.csdn.net/jackystudio/article/details/11730601 不过明眼人一看就知道起飞的不是飞机,是背景,相对运动引起的错觉. 1 ...

  7. Linux下设置开机自启动Tomcat

    方法一: linux 下tomcat开机自启动修改Tomcat/bin/startup.sh 为: export JAVA_HOME=/usr/java/j2sdk1..2_08 export CLA ...

  8. [Linux] 解压缩 tar 命令详解

    在Linux环境软件安装过程中通常需要用到解压命令,故在此总结下,以方便以后使用,若有不对之处,欢迎指正.   1. 文件压缩      通过压缩算法将文件的体积缩小,同时会将多个文件合并成至一起方便 ...

  9. magento中的各种form标签

    1. Text Field    $fieldset->addField('title', 'text', array(          'label'     => Mage::hel ...

  10. Codeforces Round #258 (Div. 2/C)/Codeforces451C_Predict Outcome of the Game(枚举)

    解题报告 http://blog.csdn.net/juncoder/article/details/38102391 题意: n场比赛当中k场是没看过的,对于这k场比赛,a,b,c三队赢的场次的关系 ...