第一步: 安装配置Remi源
Remi 源是包含最新版本 PHP 和 MySQL 包的 Linux 源,由 Remi 提供维护。有个这个源之后,使用 YUM 安装或更新 PHP、MySQL、phpMyAdmin 等服务器相关程序的时候就非常方便了。
Remi 也提供了自动安装源的 rpm 包,安装和使用都很简单。
- ## Install Remi Repository on Fedora 18, 17, 16, 15 ##
- rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
- rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
-
- ## Fedora 18 ##
- # rpm -Uvh http://rpms.famillecollet.com/remi-release-18.rpm
-
- ## Fedora 17 ##
- # rpm -Uvh http://rpms.famillecollet.com/remi-release-17.rpm
-
- ## Fedora 16 ##
- # rpm -Uvh http://rpms.famillecollet.com/remi-release-16.rpm
-
- ## Fedora 15 ##
- # rpm -Uvh http://rpms.famillecollet.com/remi-release-15.rpm
-
- ## Fedora 14 ##
- # rpm -Uvh http://rpms.famillecollet.com/remi-release-14.rpm
-
- ## Fedora 13 ##
- # rpm -Uvh http://rpms.famillecollet.com/remi-release-13.rpm
-
- ## Fedora 12 ##
- # rpm -Uvh http://rpms.famillecollet.com/remi-release-12.rpm
-
- ## Install Remi & Epel Repository on RHEL/CentOS 6.4-6.0 - 32 Bit ##
- rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
- rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
-
- ## Install Remi & Epel Repository on RHEL/CentOS 6.4-6.0 - 64 Bit ##
- rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
- rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
-
- ## Install Remi Repository on RHEL/CentOS 5.9-5.0 - 32 Bit ##
- rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
- rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
-
- ## Install Remi Repository on RHEL/CentOS 5.9-5.0 - 64 Bit ##
- rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
- rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
- ## Installing on Fedora 12, 13, 14, 15, 16, 17, 18 ##
- # yum --enablerepo=remi install httpd mysql mysql-server php php-common
-
- ## Installing on RHEL/CentOS 5-6 ##
- # yum --enablerepo=remi,remi-test install httpd mysql mysql-server php php-common
- ## Installing on Fedora 12, 13, 14, 15, 16, 17, 18 ##
- # yum --enablerepo=remi install php-mysql php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml php-pecl-apc php-cli php-pear php-pdo
-
- ## Installing on RHEL/CentOS 5-6 ##
- # yum --enablerepo=remi,remi-test install php-mysql php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml php-pecl-apc php-cli php-pear php-pdo
- ## Enable Apache and MySQL on Run-Levels ##
- # chkconfig --levels 235 httpd on
- # chkconfig --levels 235 mysqld on
-
- ## Apache Commands ##
- # /etc/init.d/httpd start
- # /etc/init.d/httpd stop
- # /etc/init.d/httpd status
-
- ## MySQL Commands ##
- # /etc/init.d/mysqld start
- # /etc/init.d/mysqld stop
- # /etc/init.d/mysqld status
1. 创建一个 phpinfo.php 的页面文件在apache的访问目录文件下,即 ( /var/www/html/phpinfo.php).文件内容如下:
- <?php
- phpinfo ();
- ?>
如果显示正常,说明你的LAMP环境基本搭建完成,接着就是在/etc下面做具体的配置工作喽!~
【欢迎各位访问远景Linux论坛版块哦,地址:http://bbs.pcbeta.com/forum-509-1.html】