第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

nginx+php-fpm+xcache

標(biāo)簽:
PHP

线上环境,centos6.3的系统。

 

1.安装nginx

wget   http://www.nginx.com.cn/download/nginx-1.3.9.tar.gz

wget  ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gzxcache

wget  http://zlib.net/zlib-1.2.8.tar.gz

wget http://www.openssl.org/source/openssl-1.0.0j.tar.gz

wget http://labs.frickle.com/files/ngx_cache_purge-2.1.tar.gz   图片缓存模块

 

 ./configure --user=www  --group=www   --prefix=/usr/local/nginx  --with-openssl=../openssl-1.0.0j --with-zlib=../zlib-1.2.8 --with-pcre=../pcre-8.30  --with-http_ssl_module  --add-module=../ngx_cache_purge-2.1 --with-http_sub_module --with-http_stub_status_module  --with-http_gzip_static_module

 

make   && make install

 

2.安装完成之后,就可以启动nginx了。

/usr/local/nginx/sbin/nginx

 

3.查看nginx有没有启动

netstat -napt  | grep  nginx     

 

4.然后通过ip访问

5.由于本机上已经有mysql了,这里就忽略掉

6.我们直接安装php了

安装php之前,我们得先安装库文件.这里就用yum安装吧

yum  -y  install   libmcrypt* mhash* libxml2* libpng* freetype* libjpeg* bzip* libcurl* 

 

./configure --prefix=/usr/local/php \--with-mysql=/usr/local/mysql --with-openssl --enable-fpm \--enable-sockets --enable-sysvshm  --with-mysqli=/usr/local/mysql/bin/mysql_config \--enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib-dir \--with-libxml-dir=/usr --enable-xml  --with-mhash --with-mcrypt  --with-config-file-path=/etc \--with-config-file-scan-dir=/etc/php.d --with-bz2 --with-curl7.中途编译的时候出现了configure: error: mcrypt.h not found. Please reinstall libmcrypt.的错误信息如果yum无法解决的话,就用编译安装吧wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz./configure  && make  && make  install然后重新配置,编译,安装 就好了 8.为php提供配置文件cp php.ini-production /etc/php.ini9.为php-fpm提供Sysv init脚本,并将其添加至服务列表cp sapi/fpm/init.d.php-fpm  /etc/rc.d/init.d/php-fpmchmod +x /etc/rc.d/init.d/php-fpmchkconfig --add php-fpmchkconfig php-fpm on10.为php-fpm提供配置文件cp /usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/php-fpm.conf11.编辑php-fpm的配置文件,配置fpm的相关选项为你所需要的值,并启用pid文件:pm.max_children =150pm.start_servers =8pm.min_spare_servers =5pm.max_spare_servers =10pid = /usr/local/php/var/run/php-fpm.pid12.启动php-fpm进程,并使用如下命令来验正(如果此命令输出有中几个php-fpm进程就说明启动成功了):service php-fpm restartps aux | grep php-fpm

13.编辑/usr/local/nginx/conf/nginx.conf,整合nginx和php,并启用如下选项:

 location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
 }


        location / {
            root   html;
            index  index.html index.htm  index.php;
        }

 

14.改完这几处地方就差不多了,重启下nginx

15.测试下php是不是能正常显示了

16.接下来开始编译xcache

wget http://xcache.lighttpd.net/pub/Releases/3.0.3/xcache-3.0.3.tar.gz

 ./configure --enable-xcache --enable-xcache-coverager  --with-php-config=/usr/local/php/bin/php-config

make  && make install

17.编辑php.ini,整合php和xcache

mkdir /etc/php.d

cp xcache.ini /etc/php.d

18.编辑/etc/php.d/xcache.ini,找到extension开头的行,修改为如下行:

extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/xcache.so

19.重新启动php-fpm进程

service php-fpm restart

chkconfig php-fpm on

20.重新打开测试页面,就可以看到了

 

點(diǎn)擊查看更多內(nèi)容
TA 點(diǎn)贊

若覺(jué)得本文不錯(cuò),就分享一下吧!

評(píng)論

作者其他優(yōu)質(zhì)文章

正在加載中
  • 推薦
  • 評(píng)論
  • 收藏
  • 共同學(xué)習(xí),寫下你的評(píng)論
感謝您的支持,我會(huì)繼續(xù)努力的~
掃碼打賞,你說(shuō)多少就多少
贊賞金額會(huì)直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊(cè)有機(jī)會(huì)得

100積分直接送

付費(fèi)專欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會(huì)
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)

舉報(bào)

0/150
提交
取消