[root@localhost public]# tar -zxvf httpd-2.2.6.tar.gz
[root@localhost public]# cd httpd-2.2.6
[root@localhost httpd-2.2.6]# ./configure --prefix=/apache #偶安装在/apache下
[root@localhost httpd-2.2.6]# make
[root@localhost httpd-2.2.6]# make install #OK,不出意外,一切OK。出了意外,赶紧google去。
[root@localhost public]# tar -zxvf mysql-5.0.45-linux-i686.tar.gz
[root@localhost public]# mv mysql-5.0.45-linux-i686 /usr/local/mysql
[root@localhost public]# cd /usr/local/mysql/
[root@localhost mysql]# groupadd mysql
[root@localhost mysql]# useradd -g mysql mysql
[root@localhost mysql]# chown -R mysql .
[root@localhost mysql]# chgrp -R mysql .
[root@localhost mysql]# scripts/mysql_install_db --user=mysql
[root@localhost mysql]# chown -R root .
[root@localhost mysql]# chown -R mysql data
[root@localhost mysql]# bin/mysqld_safe --user=mysql &
#正常情况下,mysql能正常运行,不过我是遇到了很多问题在这,就不多说了,后来都是去找问题方法的。
[root@localhost mysql]# Bin/mysqladmin –u password 1234
[root@localhost mysql]# cd /etc/init.d/
[root@localhost init.d]# cp /usr/local/mysql/support-files/mysql.server mysql
[root@localhost init.d]# chkconfig --add mysql
[root@localhost init.d]# chkconfig mysql on
[root@localhost init.d]# chkconfig --list mysql
mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@localhost init.d]# cd /var/public/
[root@localhost public]# cd php-5.2.4
[root@localhost php-5.2.4]# ./configure --with-mysql=/usr/local/mysql --with-apxs2=/apache/bin/apxs #根据自己安装情况设置哦。
[root@localhost php-5.2.4]# make
[root@localhost php-5.2.4]# make install
#安装好后,我们还需要到http.conf文件中做下配置,添加如下几个配置
[root@localhost php-5.2.4]# vi /apache/conf/httpd.conf
#确定有这几项配置,没有就添加进去
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
#啥都别说了,来个测试吧:
[root@localhost php-5.2.4]# vi /apache/htdocs/test.php