當前位置:首頁 » 編程語言 » yumphpmemcache

yumphpmemcache

發布時間: 2025-05-24 14:08:07

㈠ 用yum安裝php-fpm提示There are no enabled repos.

Nginx 本身就不用介紹了,目前使用 FastCGI 是最流行的模式.現在不少網站使用.我來介紹一個簡單的安裝方法.
先要使用第三方的源,默認的源是不存在最新的 php 的,需要 php 5.3.3 以上才有 php-fpm,所以一定要安裝這些源..

配置最新 PHP 的源

如果是 CentOS 6 和 Red Hat (RHEL) 6 的 Remi 源

rpm-Uvhhttp://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm
rpm-Uvhhttp://rpms.famillecollet.com/enterprise/remi-release-6.rpm

如果是 CentOS 5 和 Red Hat (RHEL) 5 的 Remi 源

rpm-Uvhhttp://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm-Uvhhttp://rpms.famillecollet.com/enterprise/remi-release-5.rpm

配置 Nginx 的源

我們需要建一個新的源文件,編輯 /etc/yum.repos.d/nginx.repo 就可以了.加入如下內容


[nginx]
name=nginxrepo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

安裝最新的 Nginx 和 PHP(php-fpm)

安裝最新的 Nginx 和 PHP .還有支持啟動 FastCGI 的 php-fpm 的功能.其它都是 PHP 的一些模塊了.

yum--enablerepo=remiinstallnginxphpphp-fpmphp-common
php-pearphp-pdophp-mysqlphp-pgsqlphp-pecl-memcachephp-gd
php-mbstringphp-mcryptphp-xml

安裝 MYSql 也需要使用這個的源才行


yum--enablerepo=remiinstallmysqlmysql-server

配置 Nginx 和 PHP-FPM

在 Nginx 加,給這些下面的注掉的內容打開,讓 php 的文件支持使用 fastcgi 來通信就行了.


location~.php${
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.php;
fastcgi_paramSCRIPT_FILENAME/usr/share/nginx/html$fastcgi_script_name;
includefastcgi_params;
}

測試 Nginx 和 PHP-FPM

我們需要確認 fastcgi 是否能正常的使用,所以需要在,上面的 /usr/share/nginx/html 中加入 phpinfo.php 的測試文件.


<?php
phpinfo();
?>

這時只要打開 url 來測試這個 phpinfo.php 文件是否能正常的顯示就行了.

啟動和永久啟動 Nginx 和 PHP-FPM

我們一定不想下次 Nginx 和 PHP-FPM 在也啟動不了啦,所以我們需要加入啟動中去.讓系統啟動後就能自動啟動這些.

servicenginxstart
servicephp-fpmstart
chkconfig--addnginx
chkconfig--levels235nginxon
chkconfig--addphp-fpm
chkconfig--levels235php-fpmon

熱點內容
qt源碼書嗎 發布:2025-05-24 17:43:45 瀏覽:338
sql遍歷表 發布:2025-05-24 17:38:51 瀏覽:450
x86x64體系探索及編程 發布:2025-05-24 17:15:06 瀏覽:130
區域網vpn伺服器搭建 發布:2025-05-24 17:10:33 瀏覽:192
c語言演算法復雜度 發布:2025-05-24 17:00:38 瀏覽:50
游戲腳本是什麼 發布:2025-05-24 16:33:05 瀏覽:733
wifi代理伺服器地址 發布:2025-05-24 16:25:20 瀏覽:866
安卓瀏覽器下載的文件在哪裡找到 發布:2025-05-24 15:52:18 瀏覽:148
伺服器所在主機的ip地址 發布:2025-05-24 15:45:52 瀏覽:983
本田crv空調壓縮機 發布:2025-05-24 15:30:52 瀏覽:726