CentOS 6.x安裝php 5.6和redis擴充

來源:互聯網
上載者:User

CentOS 6.x安裝php 5.6和redis擴充

安裝PHP 5.6

#yumcleanall#yumupdate整體升級一下yum包#yuminstall-yepel-release#yumlistinstalled|grepphp檢查時候安裝過PHP#rpm-Uvhhttp://mirror.webtatic.com/yum/el6/latest.rpm#yum-yinstallphp56w.x86_64#yum-y--enablerepo=webtaticinstallphp56w-devel#yum-yinstallphp56w-xml.x86_64php56w-gd.x86_64php56w-ldap.x86_64php56w-mbstring.x86_64php56w-mcrypt.x86_64php56w-mysql.x86_64php56w-pdo.x86_64php56w-opcache.x86_64#yum-yinstallphp56w-fpm#chkconfigphp-fpmon開機自啟動#/etc/init.d/php-fpmstart啟動進程#php-v查看是否安裝成功

注1:如果想更換到php5.5或5.4版本, 直接把上面的56w換成55w或者54w就可以了;

注2:php-opcache和php-xcache會有效提高php執行速度;

裝php的擴充其實不是很麻煩,主要的步驟如下:

1)在擴充模組的用戶端檔案夾裡面使用phpize,這樣會產生一個configure檔案;

2)執行configure檔案,後面要加上php的路徑;

3)將“模組.so”檔案名稱添加到php.ini檔案裡,重啟php-fpm進程;

4)通過so檔案去調用擴充模組的用戶端,實現串連對應的模組;

安裝redis擴充

#redis-cli-v檢查是否安裝了redis#redis-server-v#wgethttp://pecl.php.net/get/redis-2.2.8.tgz#tar-zxvfredis-2.2.8.tgz#cdredis-2.2.8#phpize一個專門掛接php擴充的工具,該命令一定要使用在php的模組檔案夾主目錄下,這裡報錯Cannotfindconfig.m4。因為phpize要根據模組產生模組的設定檔放在模組檔案夾下面

#./configure--with-php-config=/usr/bin/php-config#make&&makeinstall#maketest#vim/etc/php.ini在php.ini裡添加一句“extension="redis.so"”#servicephp-fpmrestart

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.