centos 瀹夎PHP7骞朵笖涓庡叾浠栫増鏈叡瀛樺苟涓斾负PHP7瀹夎redis鎵╁睍

鏍囩锛?a href='http://www.mamicode.com/so/1/php7' title='php7'>php7redis

centos 瀹夎PHP7骞朵笖涓庡叾浠栫増鏈叡瀛?/strong>

wget-c-Ophp-7.1.5.tar.gzhttp://cn2.php.net/get/php-7.1.5.tar.gz/from/this/mirror
tar-xvfphp-7.1.5.tar.gz
cdphp-7.1.5


鍦ㄥ畨瑁呬箣鍓嶉鍏堣鎼炲畾涓€浜涗緷璧栵紝涓嶈繃鏈変竴浜涗緷璧栨垜鍦ㄥ畨瑁匬HP5.6.30鐨勬椂鍊欓兘瀹夎杩囦簡锛岃繕鏈夊皯鏁伴儴鍒嗕緷璧栨病鏈夊畨瑁咃紝閭d箞鎴戜篃缁欏嚭鍏ㄦ柊鐨勪緷璧栬皝璁╂垜浠槸浼告墜鍏氾紝瀹夎杩囦簡閲嶆柊瀹夎涔熸病鍟?/p>

yuminstalllibxml2libxml2-developensslopenssl-develbzip2bzip2-devellibcurllibcurl-devellibjpeglibjpeg-devellibpnglibpng-develfreetypefreetype-develgmpgmp-devellibmcryptlibmcrypt-develreadlinereadline-devellibxsltlibxslt-devel

涓婇潰鐨勪緷璧栧畨瑁呭ソ鍚庯紝閭d箞灏辨槸閰嶇疆涓€涓婸HP7 瑕佸畨瑁呯殑璺緞涓庡紑鍚殑妯″潡绛夛紝 杩欓噷瑕佽涓€涓嬩笌mysqlq閾炬帴鐨勯厤缃紝榛樿鐨勪竴涓厤缃殑璺緞鏄?--with-mysql-sock=/tmp/mysql.sock

杩欐槸榛樿璺緞锛屽湪纭繚mysql鍚姩鐨勭姸鎬佷笅鐪嬬湅 杩欎釜mysql.sock鍦ㄤ笉锛屽鏋滀笉瀛樺湪锛屼娇鐢ㄤ笅闈㈠懡浠ゆ壘涓€涓?/p>

find/-namemysql.sock


搴旇浼氭樉绀哄叿浣撶殑璺緞锛岀劧鍚庢妸鍦板潃鏇挎崲浜嗕笂闈㈢殑閰嶇疆鐨勫湴鍧€锛屽鏋滄槸闃块噷浜戜富鏈烘湁RDS鏁版嵁搴撴垨鏈変笓鐢ㄧ殑鏁版嵁搴撴湇鍔″櫒锛岄偅涓弬鏁板氨鍙互鐩存帴骞叉帀锛屽綋鐒朵綘鍒涘缓涓€涓蒋閾炬帴涔熸槸鍙互鐨勩€?/p>

./configure--prefix=/usr/local/php7--exec-prefix=/usr/local/php7--bindir=/usr/local/php7/bin--sbindir=/usr/local/php7/sbin--includedir=/usr/local/php7/include--libdir=/usr/local/php7/lib/php--mandir=/usr/local/php7/php/man--with-config-file-path=/usr/local/php7/etc--with-mysql-sock=/var/lib/mysql/mysql.sock--with-mcrypt=/usr/include--with-mhash--with-openssl--with-mysqli=shared,mysqlnd--with-pdo-mysql=shared,mysqlnd--with-gd--with-iconv--with-zlib--enable-zip--enable-inline-optimization--enable-sockets--enable-soap--enable-session--with-curl--enable-opcache--enable-fpm--with-fpm-user=nginx--with-fpm-group=nginxmakemakeinstall



瀹夎濂藉悗锛屾潵璁剧疆PHP7鐨勯厤缃枃浠讹細php.ini php-fpm.conf鍜宲hp-fpm鍚姩鑴氭湰

cp./php.ini-production/usr/local/php7/etc/php.ini
cp./sapi/fpm/php-fpm.conf/usr/local/php7/etc/php-fpm.conf
cp/usr/local/php7/etc/php-fpm.d/www.conf.default/usr/local/php7/etc/php-fpm.d/www.conf
cp./sapi/fpm/init.d.php-fpm/etc/init.d/php7-fpm
chmod755/etc/init.d/php7-fpm


涓婇潰鐨勫懡浠ゆ墽琛屽悗锛屾潵淇敼涓€涓?usr/local/php7/etc/php-fpm.d鐩綍涓嬬殑www.conf閲岀殑 listen = 127.0.0.1:9000涓簂isten = 127.0.0.1:9001

濡傛灉鏈夎€佺増鏈殑php-fpm浣跨敤浜?000绔彛锛岄偅涔圥HP7鐨刦pm绔彛瑕佷慨鏀规垚9001锛屽叿浣撲綘鑷繁瀹?/p>

鎶妏hp7-fpm鍔犲叆寮€鏈哄惎鍔?/p>

chkconfig--addphp7-fpm
chkconfigphp7-fpmon


鍚姩php7-fpm

servicephp7-fpmstart
servicephp7-fpmstop
servicephp7-fpmrestart
servicephp7-fpmreload


start锛屽惎鍔≒HP鐨凢astCGI杩涚▼

stop锛屽己鍒剁粓姝HP鐨凢astCGI杩涚▼

quit锛屽钩婊戠粓姝HP鐨凢astCGI杩涚▼

restart锛?閲嶅惎PHP鐨凢astCGI杩涚▼

reload锛?閲嶆柊鍔犺浇PHP鐨刾hp.ini

logrotate锛?閲嶆柊鍚敤log鏂囦欢

PHP7-fpm閲嶅姩瀹屾垚鍚庯紝鏉ラ厤缃竴涓猲ginx鍙互浣跨敤PHP7

fastcgi_pass127.0.0.1:9001;




PHP7瀹夎redis


phpredis鍦╬hp7銆乸hp5涓嬮兘鏈変笉鍚岀殑鐗堟湰锛岃宀斾簡鍙兘浼氱紪璇戞姤閿欙紝鎵€浠ュ湪瀹夎涔嬪墠璇峰厛鐪嬩笅鑷繁鐨凱HP鏄暐鐗堟湰銆?/p>

鎴戠殑Redis瑁呯殑鏄痳edis3.2.3鐗堟湰銆?/p>

鐢╬hpinfo()鏌ョ湅瀹夎鐨刾hp淇℃伅銆?/p>

纭鏄痯hp7鍚庡紑濮嬪畨瑁呫€?/p>

涓嬭浇鍦板潃: https://github.com/phpredis/phpredis/archive/php7.zip

澶嶅埗鍒?usr/local鐩綍涓嬭В鍘嬶細unzip phpredis-php7.zip

鐒跺悗杩涘叆瑙e帇鍚庣殑鏂囦欢鐨勭洰褰曪紝寮€濮嬮噸鏂扮紪璇憄hpize锛?/p>

cdphpredis-php7
/usr/local/php/bin/phpize
./configure--with-php-config=/usr/local/php/lib/php-config

娉ㄦ剰杩欎釜php-config鏂囦欢鏈夌殑鐗堟湰鏄湪/usr/local/php/bin涓嬶紝瑁呯殑鏃跺€欏鎵炬壘

makemakeinstall

鏈€鍚庡湪/usr/local/php/lib/php.ini 閲岄潰鍔犲叆锛歟xtension=redis.so php.ini鏂囦欢涔熸槸钘忓尶鍦╨ib銆乪tc銆乥in杩欎花涔嬩竴锛岃鐨勬椂鍊欏鎵炬壘

閲嶅惎HTTP搴旂敤绋嬪簭濡傦細nginx

杩欐椂鍊欏啀娆℃墦寮€phpinfo()椤甸潰锛屾悳绱edis鐪嬭兘涓嶈兘鎵惧埌


澶у姛鍛婃垚锛?/p>



鏈枃鍑鸿嚜 鈥?a href=鈥榟ttp://happyliu.blog.51cto.com鈥?寮€蹇冪紪绋媉姘告棤姝㈠鈥?鍗氬锛岃鍔″繀淇濈暀姝ゅ嚭澶?a href=鈥榟ttp://happyliu.blog.51cto.com/501986/1954337鈥?http://happyliu.blog.51cto.com/501986/1954337

centos 瀹夎PHP7骞朵笖涓庡叾浠栫増鏈叡瀛樺苟涓斾负PHP7瀹夎redis鎵╁睍

鏍囩锛?a href='http://www.mamicode.com/so/1/php7' title='php7'>php7redis

鍘熸枃鍦板潃锛歨ttp://happyliu.blog.51cto.com/501986/1954337


最新回复(0)
/jishu3F1PIqg2mH8eprFGbWgDuc4aVsMvHhgPCN_2FpMEv_2FCk8_3D4718982
8 简首页