CentOS 6.5 安装 php7 教程 包很重要使用lnmp1.4里面的包
./configure \
--prefix=/usr/local/php-7.0.1 \
--with-mysql=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-iconv-dir=/usr/local/libiconv \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir=/usr \
--enable-xml \
--disable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--enable-mbregex \
--enable-fpm \
--enable-mbstring \
--with-mcrypt \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-soap \
--enable-short-tags \
--enable-static \
--with-xsl \
--with-fpm-user=www \
--with-fpm-group=www \
--enable-ftp \
--enable-opcache=no
CentOS 6.5 安装 php7 教程
1、安装前先更新所需要的模块
yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel mysql pcre-devel curl curl-devel libxslt-devel
1
2、下载php7
wget http://cn2.php.net/get/php-7.0.4.tar.gz/from/this/mirror
1
3、解压php7
tar -zxvf php-7.0.4.tar.gz
1
4、进去php-7.0.4目录
cd php-7.0.4
1
5、编译安装到/usr/local/php目录下
./configure --prefix=/usr/local/php \
--with-curl \
--with-freetype-dir \
--with-gd \
--with-gettext \
--with-iconv-dir \
--with-kerberos \
--with-libdir=lib64 \
--with-libxml-dir \
--with-mysqli \
--with-openssl \
--with-pcre-regex \
--with-pdo-mysql \
--with-pdo-sqlite \
--with-pear \
--with-png-dir \
--with-xmlrpc \
--with-xsl \
--with-zlib \
--enable-fpm \
--enable-bcmath \
--enable-libxml \
--enable-inline-optimization \
--enable-gd-native-ttf \
--enable-mbregex \
--enable-mbstring \
--enable-opcache \
--enable-pcntl \
--enable-shmop \
--enable-soap \
--enable-sockets \
--enable-sysvsem \
--enable-xml \
--enable-zip
如果没有error信息,就可以执行下边的安装了:
make && make install
1
6、配置文件
# cp php.ini-development /usr/local/php/lib/php.ini
# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
# cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
# cp -R ./sapi/fpm/php-fpm /etc/init.d/php-fpm
1
2
3
4
7、 启动
/etc/init.d/php-fpm
1
8、查看是否启动
ps aux | grep php
1
修改nginx配置,监听*.php的文件
vim /usr/local/nginx/conf/nginx.conf
1
简单配置如下:
user www www;
worker_processes 10;
#error_log /data/logs/nginx_error.log crit;
#pid logs/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;
events
{
use epoll;
worker_connections 51200;
}
http
{
include mime.types;
default_type application/octet-stream;
#charset gbk;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
#client_max_body_size 8m;
server_tokens off;
expires 1h;
sendfile on;
tcp_nopush on;
keepalive_timeout 60;
tcp_nodelay on;
error_page 404 /404.jpg;
fastcgi_connect_timeout 20;
fastcgi_send_timeout 30;
fastcgi_read_timeout 120;
fastcgi_buffer_size 256k;
fastcgi_buffers 8 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_temp_path /dev/shm;
gzip on;
gzip_min_length 2048;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/xml application/x-javascript ;
log_format access '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm index.php;
}
#rewrite index.php/^(.*)$ idex.php?s=/$1 last ;
#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 html;
}
location ~ \.php$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
}
################# include ###################
# include block_ips.conf ;
# include vhost/*.conf ;
#强制域名访问对应域名的conf
# server {
# listen 80 default ;
# server_name _;
# return 404;
# }
}
最后phpinfo(),成功。
CentOS 6.5 安装 php7 教程 包很重要使用lnmp1.4里面的包的更多相关文章
- (转载)Centos下Elasticsearch安装详细教程
原文地址:http://www.cnblogs.com/sunny1009/articles/7874251.html Centos下Elasticsearch安装详细教程 1.Elasticsear ...
- Centos下Elasticsearch安装详细教程
Centos下Elasticsearch安装详细教程 1.Elasticsearch简介 ElasticSearch是一个基于Lucene的搜索服务器.它提供了一个分布式多用户能力的全文搜索引擎,基于 ...
- CentOS yum如何安装php7.4
centos系统下使用yum安装php7.4正式版,当前基于WLNMP提供的一键安装包来安装 1.添加epel源 yum install epel-release 2.添加WLNMP一键安装包源 rp ...
- CentOS通过yum安装php7.0
一.删除旧版本 如果已经安装过php就先删除之前的版本.检查方法如下: yum list installed | grep php 然后将安装的包进行删除 比如 yum remove php.x86_ ...
- centos 7.2 安装PHP7.1+apache2.4.23
安装准备: http://ftp.cuhk.edu.hk/pub/packages/apache.org//httpd/httpd-2.4.23.tar.gz 下载apache http://cn ...
- CentOS 5.5安装图解教程
说明:实际生产环境中,CentOS 5.5这个版本相当稳定,而且硬件兼容性也很好,是很多服务器装机者的首选系统,下面介绍CentOS 5.5的具体安装过程 说明:实际生产环境中,CentOS 5. ...
- CentOS 7.5 安装Docker 教程
Docker简介 Docker是一个开源的容器引擎,它有助于更快地交付应用.Docker可将应用程序和基础设施层隔离,并且能将基础设施当作程序一样进行管理. 使用Docker可更快地打包.测试以及部署 ...
- Centos 7 下安装PHP7.2(与Apache搭配的安装方式)
(1)源码包下载 百度云下载地址:https://pan.baidu.com/s/1xH7aiGYaX62wij4ul5P-ZQ 提取码:m9zc (2)安装php依赖组件: yum -y insta ...
- Centos下Yum安装PHP7.0
默认的版本太低了,手动安装有一些麻烦,想采用Yum安装的可以使用下面的方案: 1.检查当前安装的PHP包 yum list installed | grep php 如果有安装的PHP包,先删除他们 ...
随机推荐
- 【pyhon】nvshens按目录图片批量下载爬虫1.00(多线程版)
# nvshens按目录图片批量下载爬虫1.00(多线程版) from bs4 import BeautifulSoup import requests import datetime import ...
- Ubuntu下压缩包内文件解压后乱码问题的解决
用到的工具是The Unarchiver项目提供的lsar/unar工具. The Unarchiver项目主页:http://code.google.com/p/theunarchiver/ 安装( ...
- FileUpload类中FileUpload1.FileName和FileUpload1.PostedFile.FileName的区别
FileUpload1.FileName 用来获取客户端上使用 FileUpload 控件上载的文件的名称.此属性返回的文件名不包含此文件在客户端上的路径.FileUpload1.PostedFile ...
- Install fail! Error: [@@babel/runtime/core-js/object/keys]
1.Install fail! Error: [@@babel/runtime/core-js/object/keys] "@babel/runtime": "7.0.0 ...
- 从缓存行出发理解volatile变量、伪共享False sharing、disruptor
volatilekeyword 当变量被某个线程A改动值之后.其他线程比方B若读取此变量的话,立马能够看到原来线程A改动后的值 注:普通变量与volatile变量的差别是volatile的特殊规则保证 ...
- CentOS7——gitlab本地git仓库搭建 以及web hook配置
整个搭建用的都是各种默认设置,所以没有用到高深的的东西,比较简单,比较傻瓜式,这篇也仅仅是一个入门. 另外本文具有时效性,浏览本文请注意发表时间,为防止过时产生误导,本文尽量把 “如何得知应该这样做” ...
- 数据库选型之MySQL(固态硬盘)
刘勇 Email: lyssym@sina.com 本博客记录作者在工作与研究中所经历的点滴,一方面给自己的工作与生活留下印记,另一方面若是能对大家有所帮助,则幸甚至哉矣! 简介 鉴于高频中心库 ...
- How to authenticate a user by uid and password?
原文地址:Authentication options | Basic authorization If you want to use simple binds with user DN and p ...
- 转载【微信支付】jsapi支付之传参问题(使用微信官方SDK之PHP版本) V3之WxpayPubHelper 亲测有效,V3WxpayAPI_php_v3.zip版未测试,理论上也是一样的。
本文转载至:http://blog.csdn.net/geeklx/article/details/51146151 (微信支付现在分为v2版和v3版,2014年9月10号之前申请的为v2版,之后申请 ...
- [译]聊聊C#中的泛型的使用(新手勿入) Seaching TreeVIew WPF 可编辑树Ztree的使用(包括对后台数据库的增删改查) 字段和属性的区别 C# 遍历Dictionary并修改其中的Value 学习笔记——异步 程序员常说的「哈希表」是个什么鬼?
[译]聊聊C#中的泛型的使用(新手勿入) 写在前面 今天忙里偷闲在浏览外文的时候看到一篇讲C#中泛型的使用的文章,因此加上本人的理解以及四级没过的英语水平斗胆给大伙进行了翻译,当然在翻译的过程中发 ...