MySQL+PHP+APACHE的安装
时间:2009-05-22 来源:leigaiting
一:下载软件
Apache_1.3.33 http://www.apache.org
PHP_5.0.2 http://www.php.net
libxml2-2.6.11 http://www.xmlsofe.org
MySQL-3.23.57-1.i386.rpm(MySQL服务器) http://www.mysql.com
MySQL-client-3.23.57-1.i386.rpm(MySQL客户实用程序) http://www.mysql.com
MySQL-devel-3.23.57-1.i386.rpm(MySQL包含文件和库) http://www.mysql.com
MySQL-shared-3.23.57-1.i386.rpm(客户程序共享库) http://www.mysql.com
二: 安装MySQL
一般安装linux时候会帮助安装mysql,所以现在检查一下系统是否已经安装了
rpm -q mysql (小写噢)假如有的话就删除它
rpm -e --nodeps mysql 不删除的话等会安装MySQL的时候会出现版本冲突.强制删除
rpm -ivh --force MySQL-3.23.57-1.i386.rpm 没办法.老是有冲突,只能强制安装拉.
rpm -ivh --force MySQL-client-3.23.57-1.i386.rpm
rpm -ivh --force MySQL-devel-3.23.57-1.i386.rpm
rpm -ivh --force MySQL-shared-3.23.57-1.i386.rpm
这时再用rpm -q一下看是否把上面四个部分安装完毕了.
三:安装libxml
cd /usr/local/libxml2-2.6.11
./configure
make
make install
四:编译安装apache(假如你要安装SSL的话那前面还要编译mod_ssl拉)
cd /usr/local/apache_1.3.33
./configure --prefix=/usr/local/apache --enable-module=so
make
make install
五:配置PHP并编译和安装
cd /usr/local/php
./configure --with-apxs=/usr/local/apache/bin/apxs --with-mysql --with-config-file-path=/usr/local/lib --with-libxml-dir=../libxml
make
make install
cp php.ini-dist /usr/local/lib/php.ini
六:修改/usr/local/apache/conf/httpd.conf
vi /usr/local/apache/conf/httpd.conf
AddType application/x-httpd-php .php .php3
七:测试
vi /usr/local/apache/htdocs/1.php也就是新建一个PHP文件,输入下面一段
Apache_1.3.33 http://www.apache.org
PHP_5.0.2 http://www.php.net
libxml2-2.6.11 http://www.xmlsofe.org
MySQL-3.23.57-1.i386.rpm(MySQL服务器) http://www.mysql.com
MySQL-client-3.23.57-1.i386.rpm(MySQL客户实用程序) http://www.mysql.com
MySQL-devel-3.23.57-1.i386.rpm(MySQL包含文件和库) http://www.mysql.com
MySQL-shared-3.23.57-1.i386.rpm(客户程序共享库) http://www.mysql.com
二: 安装MySQL
一般安装linux时候会帮助安装mysql,所以现在检查一下系统是否已经安装了
rpm -q mysql (小写噢)假如有的话就删除它
rpm -e --nodeps mysql 不删除的话等会安装MySQL的时候会出现版本冲突.强制删除
rpm -ivh --force MySQL-3.23.57-1.i386.rpm 没办法.老是有冲突,只能强制安装拉.
rpm -ivh --force MySQL-client-3.23.57-1.i386.rpm
rpm -ivh --force MySQL-devel-3.23.57-1.i386.rpm
rpm -ivh --force MySQL-shared-3.23.57-1.i386.rpm
这时再用rpm -q一下看是否把上面四个部分安装完毕了.
三:安装libxml
cd /usr/local/libxml2-2.6.11
./configure
make
make install
四:编译安装apache(假如你要安装SSL的话那前面还要编译mod_ssl拉)
cd /usr/local/apache_1.3.33
./configure --prefix=/usr/local/apache --enable-module=so
make
make install
五:配置PHP并编译和安装
cd /usr/local/php
./configure --with-apxs=/usr/local/apache/bin/apxs --with-mysql --with-config-file-path=/usr/local/lib --with-libxml-dir=../libxml
make
make install
cp php.ini-dist /usr/local/lib/php.ini
六:修改/usr/local/apache/conf/httpd.conf
vi /usr/local/apache/conf/httpd.conf
AddType application/x-httpd-php .php .php3
七:测试
vi /usr/local/apache/htdocs/1.php也就是新建一个PHP文件,输入下面一段
<?
$myvar="Hello,World!";
echo $myvar;
phpinfo();
?>
启动apache服务
/usr/local/apache/bin/apachectl stop
/usr/local/apache/bin/apachectl start
浏览器中输入127.0.0.1/1.php此时应该看到很多表格,呵呵那恭喜你,php安装成功了
相关阅读 更多 +