php 5.5.1 编译安装过程
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 需要指定具体的路径。
这是最基本的配置,并没有做具体的优化。
最新文章
- 小试牛刀--利用豆瓣API爬取豆瓣电影top250
- 2015/09/09夜晚js继续学习
- NGINX下配置404错误页面的方法分享
- Hadoop第4周练习—HDFS读写文件操作
- [moka同学笔记]yii2.0小物件的简单使用(第二种方法)
- Best Time to Buy and Sell Stock II
- Java条件语句之 switch
- class0513(html)
- 在非MFC的win 32程序里面能够使用CString类
- 网易云课堂_C语言程序设计进阶_第一周:数据类型:整数类型、浮点类型、枚举类型_1计算分数精确值
- lodop 打印控件的使用
- js框架漫谈
- python#读csv,excel,json数据
- plot与legend画图与图例
- 【ARTS】01_09_左耳听风-20190107~20190113
- 内网渗透中的NTLM-Hash Relay
- 结构体内的函数与bfs的情景变量
- JSP include 指令
- Java数据结构和算法(二)顺序存储的树结构
- angularjs ui-grid cellTemplate checkbox ng-checked