lamp環境爲(Linux+Apache+MySQL+PHP)
使用 yum 程序安裝所需開發包(如下爲標準的rpm包名稱)
# yum -y install gcc gcc-c++ gcc-g77 flex bison autoconf automake bzip2-devel zlib-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel openssl-devel libxml2-devel gettext-devel pcre-devel
安裝mysql
########################>>mysql
yum -y install mysql mysql-server
chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start
//安裝完mysql後須要啓動激活mysql
mysqladmin -u root password 123456 (自行修改!!)
配置mysql的密碼
安裝apache
########################>>apache
yum -y install httpd
chkconfig --levels 235 httpd on
/etc/init.d/httpd start
apache的web存放目錄
/var/www/html
apache的配置文件
/etc/httpd/conf/httpd.conf
安裝php
########################>>php
yum -y install php
/etc/init.d/httpd restart
重啓激活php
測試php是否安裝完成
vi /var/www/html/info.php
<?php
phpinfo();
?>
yum search php
搜索php的相關的組件
安裝php的組件
yum -y install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc
/etc/init.d/httpd restart
重啓激活php
安裝phpmyadmin工具(32位環境)
########################>>phpmyadmin
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.i386.rpm
yum -y install phpmyadmin php
vi /etc/httpd/conf.d/phpmyadmin.conf html
修改phpmyadmin的配置文件來容許訪問
<Directory "/usr/share/phpmyadmin">
Order Deny,Allow
# Deny from all
# Allow from 127.0.0.1
Allow from all //這裏改爲all是能夠從全部IP訪問到phpmyadmin
</Directory> mysql
Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin c++
vi /usr/share/phpmyadmin/config.inc.php web
$cfg['blowfish_secret'] = 'oracle'; sql
$cfg['Servers'][$i]['auth_type'] = 'cookie'; apache
$cfg['Servers'][$i]['host'] = 'localhost'; cookie
$cfg['Servers'][$i]['controluser'] = 'root'; oracle
$cfg['Servers'][$i]['controlpass'] = '*********'; 工具
#service httpd restart