- 论坛徽章:
- 0
|
前几天把linux删掉重装了,又重新搭建了mysql+apache+php环境,我把安装过程整理成了文档。
1.1 安装准备
- 机器环境:RedHat Linux 9
- 下载mysql安装包:MySQL-server-4.1.12-1.i386.rpm,MySQL-client-4.1.12-1.i386.rpm
- 下载apache安装包:apache_1.3.33.tar.gz
- 下载php安装包:php-4.3.11.tar.gz
- tar zxvf php-4.3.11.tar.gz,将文件解压到/usr/local/src
- tar zxvf apache_1.3.33.tar.gz,将文件解压到/usr/local/src
1.2 安装mysql
安装mysql服务器端程序:rpm -ivh MySQL-server-4.1.12-1.i386.rpm
安装mysql客户端程序: rpm -ivh MySQL-client-4.1.12-1.i386.rpm
$mysql,可以看到
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1 to server version: 4.1.12-standard
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql>
1.3 安装php
进入apache的安装文件目录,输入:./configure --prefix=/usr/local/httpd
进入php的安装文件目录,输入:./configure --prefix=/usr/local/php --with-mysql --with-apache=../apache_1.3.33
make && make install
cp php.ini-dist /usr/local/php/lib/php.ini
建立符号链接 ln -s /usr/local/php/bin/php /usr/bin/php
1.4 安装apache
进入apache的安装文件目录,输入:./configure --prefix=/usr/local/httpd --activate-module=src/modules/php4/libphp4.a --enable-module=so --enable-module=rewrite
make && make install
确保/usr/local/httpd/conf/httpd.conf中有以下内容
DirectoryIndex index.html index.php
...
AddType application/x-httpd-php .php
建立符号链接 ln -s /usr/local/httpd/bin/apachectl /usr/bin/apache
重启apache : apache restart
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/1777/showart_35856.html |
|