確定依賴包安裝
為洞口等地區(qū)用戶提供了全套網(wǎng)頁(yè)設(shè)計(jì)制作服務(wù),及洞口網(wǎng)站建設(shè)行業(yè)解決方案。主營(yíng)業(yè)務(wù)為網(wǎng)站設(shè)計(jì)、成都做網(wǎng)站、洞口網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠(chéng)的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會(huì)得到認(rèn)可,從而選擇與我們長(zhǎng)期合作。這樣,我們也可以走得更遠(yuǎn)!gcc gcc-c++ libxml2 libxml2-devel bzip2 bzip2-devel libmcrypt libmcrypt-devel openssl openssl-devel libcurl-devel libjpeg-devel libpng-devel freetype-devel readline readline-devel libxslt-devel perl perl-devel psmisc.x86_64 recode recode-devel libtidy libtidy-devel
若沒(méi)安裝,掛載系統(tǒng)鏡像,從Packages文件夾里面找到安裝包安裝,或者有yum源的話可直接yum install安裝。
可利用鏡像自己制作本地yum源:http://kurol.blog.51cto.com/11433546/1927721
從官網(wǎng)獲取,編譯安裝
[root@kurolz ~]# wget http://de2.php.net/get/php-5.5.38.tar.gz/from/this/mirror [root@kurolz ~]# tar -zxvf php-5.5.38.tar.gz [root@kurolz php-5.5.38]# ./configure --prefix=/usr/local/php-5.5.0 --with-config-file-path=/usr/local/php-5.5.0/etc --with-bz2 --with-curl --enable-ftp --enable-sockets --disable-ipv6 --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-freetype-dir=/usr/local --enable-gd-native-ttf --with-iconv-dir=/usr/local --enable-mbstring --enable-calendar --with-gettext --with-libxml-dir=/usr/local --with-zlib --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql=mysqlnd --enable-dom --enable-xml --enable-fpm --with-libdir=lib64 ...... creating main/internal_functions_cli.c +--------------------------------------------------------------------+ | License: | | This software is subject to the PHP License, available in this | | distribution in the file LICENSE. By continuing this installation | | process, you are bound by the terms of this license agreement. | | If you do not agree with the terms of this license, you must abort | | the installation process at this point. | +--------------------------------------------------------------------+ Thank you for using PHP. config.status: creating php5.spec config.status: creating main/build-defs.h config.status: creating scripts/phpize config.status: creating scripts/man1/phpize.1 config.status: creating scripts/php-config config.status: creating scripts/man1/php-config.1 config.status: creating sapi/cli/php.1 config.status: creating sapi/fpm/php-fpm.conf config.status: creating sapi/fpm/init.d.php-fpm config.status: creating sapi/fpm/php-fpm.service config.status: creating sapi/fpm/php-fpm.8 config.status: creating sapi/fpm/status.html config.status: creating sapi/cgi/php-cgi.1 config.status: creating ext/phar/phar.1 config.status: creating ext/phar/phar.phar.1 config.status: creating main/php_config.h config.status: executing default commands [root@kurolz ~]# make [root@kurolz ~]# make install [root@kurolz ~]# cd php-5.5.38 [root@kurolz php-5.5.38]# cp php.ini-production /usr/local/php-5.5.0/etc/php.ini [root@kurolz php-5.5.38]# cd /usr/local/php-5.5.0/etc/ [root@kurolz etc]# cp php-fpm.conf.default php-fpm.conf [root@kurolz etc]# cd /usr/local/php-5.5.0/sbin [root@kurolz sbin]# ./php-fpmNginx與php連接
要點(diǎn):
1:Nginx 默認(rèn)支持 fastcgi
2:php編譯開(kāi)啟模塊:
--enable-fpm
連接:
[root@kurolz ~]# vim /usr/local/nginx/conf/nginx.conf server { listen 80; server_name localhost; location / { root html; index index.html index.php; } ....... location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }重啟nginx:
[root@kurolz ~]# cd /usr/local/nginx/sbin [root@kurolz sbin]# ./nginx -s reload添加php測(cè)試文件:
[root@kurolz ~]# cd /usr/local/nginx/html [root@kurolz ~]# touch info.php [root@kurolz ~]# vim info.php<?php phpinfo(); ?>瀏覽器測(cè)試:
將pid文件存于var/run中
[root@kurolz ~]# vim /usr/local/php-5.5.0/etc/php-fpm.conf pid = run/php-fpm.pid配置開(kāi)機(jī)啟動(dòng)php-fpm
并可用service php-fpm [start | restart | stop]開(kāi)啟、重啟、關(guān)閉
[root@kurolz ~]# vim /etc/init.d/php-fpm將下列腳本寫(xiě)入/etc/init.d/php-fpm中,12-15行的路徑自己修改
#!/bin/sh # # php-fpm - this script starts and stops the php-fpm daemin # # chkconfig: - 85 15 # processname: php-fpm # config: /usr/local/php/etc/php-fpm.conf set -e PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DESC="php-fpm daemon" NAME=php-fpm DAEMON=/usr/local/php-5.5.0/sbin/php-fpm CONFIGFILE=/usr/local/php-5.5.0/etc/php-fpm.conf PIDFILE=/usr/local/php-5.5.0/var/run/php-fpm.pid SCRIPTNAME=/etc/init.d/php-fpm # If the daemon file is not found, terminate the script. test -x $DAEMON || exit 0 d_start(){ $DAEMON -y $CONFIGFILE || echo -n " already running" } d_stop(){ kill -QUIT `cat $PIDFILE` || echo -n " no running" } d_reload(){ kill -HUP `cat $PIDFILE` || echo -n " could not reload" } case "$1" in start) echo -n "Starting $DESC: $NAME" d_start echo "." ;; stop) echo -n "Stopping $DESC: $NAME" d_stop echo "." ;; reload) echo -n "Reloading $DESC configuration..." d_reload echo "Reloaded." ;; restart) echo -n "Restarting $DESC: $NAME" d_stop # Sleep for two seconds before starting again, this should give the nginx daemon some time to perform a graceful stop sleep 2 d_start echo "." ;; *) echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload)" >&2 exit 3 ;; esac exit 0賦予php-fpm任何用戶可執(zhí)行權(quán)限
[root@kurolz ~]# chmod a+w /etc/init.d/php-fpm設(shè)置開(kāi)機(jī)啟動(dòng)
[root@kurolz ~]# chkconfig php-fpm on另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。
文章名稱:Linux-rhel6.4編譯安裝PHP,Nginx與php連接-創(chuàng)新互聯(lián)
文章起源:http://muchs.cn/article8/pgiop.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)建站、用戶體驗(yàn)、網(wǎng)站收錄、網(wǎng)站維護(hù)、響應(yīng)式網(wǎng)站、網(wǎng)站改版
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容