centos6.6 下 安装 php7 + nginx环境的方法
发表于:2024-10-22 作者:千家信息网编辑
千家信息网最后更新 2024年10月22日,本文实例讲述了centos6.6 下 安装 php7 + nginx环境的方法。分享给大家供大家参考,具体如下:1、安装必要的依赖库> yum -y install gd zlib libjpeg l
千家信息网最后更新 2024年10月22日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安全错误
数据库的锁怎样保障安全
网络安全法规组织
网络安全风险如何防止
软件开发云有哪些
网络安全法网络安全
华为服务器管理口kvm
翔优网络安全工程师
信息会考网络技术应用试题
软件开发大学生培训班
奋达科技软件开发面试
南京哪里能学习软件开发
方舟怎么进其他服务器玩
广域网络技术种类
软件开发公司收入确认时点
大学教的数据库有用吗
苏木镇网络安全维护人员
数据库连接对象所属的类的类名为
手机内置软件开发
猫空互联网科技苏州有限公司
计算机网络安全涉及内容
祥云杯网络安全2021
武汉门户云网络技术有限公司
学生网络安全法心得
成都云端网络技术有限公司
云网络安全服务端点
中国网络安全第五届
济南米谷网络技术
实现数据库安全的主要方法
惠州安卓软件开发哪家好
兄弟联软件开发
水资源安全 数据库