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上安装 OpenNebula Management Console
- yum命令安装软件时,出现--centos 7 安装apache 出现 Could not resolve host: mirrorlist.centos.org; 未知的错误"--CentOS网络设置 couldn't resolve host 'mirrorlist.centos.org问题解决
- CentOS系统使用yum安装配置MariaDB数据库
- Linux/CentOS 服务安装/卸载,开机启动chkconfig命令详解|如何让MySQL、Apache开机启动?
- 如何在CentOS 7安装Node.js
- centos定时删除log文件
- virtualbox虚拟机上安装centOS的网络配置
- Centos如何安装163yum源
- CentOS安装Node.js简单教程
- Centos系统安装JDK详细图文教程
- CentOS报错:Could not retrieve mirrorlist http://mirrorlist.centos.org
- CentOS 6.4 搭建SVN服务器
- 在 CentOS 6.x上安装 docker.io成功
- 【原创】安装 CentOS 5.6 后启动无法进入图形界面
- Virtualbox虚拟机安装CentOS 6.5图文详细教程
- centos根目录扩容,home目录减小容量
- Centos下安装apahce的configure: error: APR not found. Please read the documentation解决办法
- Linux centos openshift安装教程整理
- centos 源码安装 code:blocks方法和注意项
- CentOS 7 安装 Postfix Dovecot
- CentOS 7 安装配置 Rsync 实现数据同步
- 如何在windows上安装centos单系统,以及安装事项和 centOS Linux和centOS Stream区别
- centos 添加rpmfusion源,yum 安装 ffmpeg
- 【云原生 | 02】分别在CentOS、Ubuntu、macOS、win7、win8、win10等不同操作系统下安装Docker详细教程
- CentOS 7迁移Anolis OS 7 ——筑梦之路
- Centos 6.5使用Bumblebee关闭N卡,冷却你的电脑
- Centos 5.5 安装Mysql5.5过程
- GO语言教程(一)Linux( Centos)下Go的安装, 以及HelloWorld
- CentOS 6.4下编译安装MySQL 5.6.14 (转)
- Linux|科普扫盲帖|配置网络软件源---阿里云镜像仓库服务使用(centos,Ubuntu)
- Centos 安装Firefox
- 02 从头开始atac项目 ubuntu20 install r4.2 Linux系统环境配置 服务器版本的rstudio r install in linux /ubuntu/centos