centos6.6 下 安装 php7 + nginx环境的方法
发表于:2025-02-02 作者:千家信息网编辑
千家信息网最后更新 2025年02月02日,本文实例讲述了centos6.6 下 安装 php7 + nginx环境的方法。分享给大家供大家参考,具体如下:1、安装必要的依赖库> yum -y install gd zlib libjpeg l
千家信息网最后更新 2025年02月02日centos6.6 下 安装 php7 + nginx环境的方法
本文实例讲述了centos6.6 下 安装 php7 + nginx环境的方法。分享给大家供大家参考,具体如下:
1、安装必要的依赖库
> yum -y install gd zlib libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel openssl openssl-devel curl-devel libxslt-devel
2、下载php源码包
http://php.net/downloads.php
文件名为:php-7.0.4.tar.gz
3、解压源码包
> tar -zxvf php-7.0.4.tar.gz
4、进入目录,并configure
./configure --prefix=/data/nmp/php \--with-curl \--with-freetype-dir \--with-gd \--with-gettext \--with-iconv-dir \--with-kerberos \--with-libdir=lib \--with-libxml-dir \--with-mysqli=mysqlnd \--with-openssl \--with-pcre-regex \--with-pdo-mysql=mysqlnd \--with-pdo-sqlite \--with-pear \--with-png-dir \--with-xmlrpc \--with-xsl \--with-zlib \--enable-mysqlnd \--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 \--enable-pthreads \--enable-maintainer-zts \--enable-fileinfo
5、make && make install
> make && make install
6、配置文件
> cp php.ini-development /data/nmp/php/lib/php.ini> cp /data/nmp/php/etc/php-fpm.conf.default /data/nmp/php/etc/php-fpm.conf> cp /data/nmp/php/etc/php-fpm.d/www.conf.default /data/nmp/php/etc/php-fpm.d/www.conf> cp -R ./sapi/fpm/php-fpm /data/nmp/php/etc/init.d/php-fpm
(*需要创建init.d目录)
7、启动
> /data/nmp/php/etc/init.d/php-fpm
8、nginx整合php
> vi /data/nmp/nginx/conf/nginx.confserver { listen 80; server_name localhost; charset utf-8; #root网站的目录 location / { root /data/wwwroot; index index.html index.htm index.php; } location ~ \.php$ { #网站目录 root /data/wwwroot; #phpcgi端口,默认9000 fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; #document_root指向的就是网站目录 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }}
9、重新加载nginx
> /data/nmp/nginx/sbin/nginx -s reload
希望本文所述对大家centos环境配置有所帮助。
目录
网站
环境
文件
源码
配置
方法
必要
实例
就是
指向
端口
参考
帮助
整合
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
网络安全课程答疑
英雄联盟手游国际服服务器炸了
ios数据库类型
网络安全 红蓝队
计算机网络技术专业出来都干啥了
首都网络安全日在那里
数据库保存登录地址在哪里
auss云数据库
数据库中文字母对应
试验数据如何存储到数据库
瑞恩数据库
网络安全漏洞重灾区
python服务器监测
苹果服务器会被墙吗
激战2目前有几个服务器
闵行区品牌软件开发包括什么
网络安全医院三级评审
软件开发tr4
游戏怎么挂远端服务器
用表格怎么做类似数据库
山东州讯网络技术有限公司
华为基站软件开发岗位前景
网络安全 逆向
客户端数据库配置文件
无主之地3服务器掉线
高效物联网大数据平台软件开发
网络安全与国家安全的事件
健康网络安全儿童画
中央控制服务器是什么
互联网科技公司缴纳税点