大旗谷资源网 Design By www.zqyou.com
本文实例讲述了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.conf server { 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环境配置有所帮助。
大旗谷资源网 Design By www.zqyou.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
大旗谷资源网 Design By www.zqyou.com
暂无centos6.6 下 安装 php7 + nginx环境的方法的评论...
更新日志
2024年10月18日
2024年10月18日
- 群星《歌手2024 第4期》[FLAC/分轨][563.76MB]
- RiffKitten-ChaosParade(2024)[24-44,1]FLAC
- RuneKlakegg-Nattevandrer(2024)[24-96]\FLAC
- 赖冰霞.2006-金嗓典藏辑2IN1(南方金点系列)2CD【南方】【WAV+CUE】
- 群星.1988-国语金曲尽精英VOL.2【瑞成】【WAV+CUE】
- 张宇.1999-雨一直下【EMI百代】【WAV+CUE】
- 袁娅维.2021-月亮失眠了(DELUXE)【华纳】【FLAC分轨】
- AlanBroadbent-JazzFunk(2024)[24-44,1]
- 梅艳芳《绝代芳华》开盘母带[低速原抓WAV+CUE]
- ABC唱片-《外国精逊母带直刻神奇黑胶[APE+CUE].
- 群星《天赐的声音第五季 第6期》[320K/MP3][101.43MB]
- 群星《天赐的声音第五季 第6期》[FLAC/分轨][526.16MB]
- 群星《说唱梦工厂 第2期》[320K/MP3][96.37MB]
- 杨宗宪.1994-留你留袂着【有容唱片】【WAV+CUE】
- 李翊君.2005-勇敢的爱【创意唱片】【WAV+CUE】