install MYSQL+PHP+APACHE on Linux

本文提供了一步一步的指南来安装MySQL数据库、PHP语言和Apache Web服务器。包括从下载压缩包到配置各组件的具体步骤,适用于希望自行搭建LAMP环境的用户。
在这个 网址www.chinaunix.net/
下载mysql-5.0.21.tar.gz
php-5.1.4.tar.bz2
apache_1.3.36.tar.gz

安装mysql

解压后得到的文件夹mysql-5.0.21
在./mysql-5.0.21下
./configure -prefix=/usr/local/mysql        这是设置安装路径
make                这里需要很长时间
make install

安装php + apache
 
 
1.  gunzip -c apache_1.3.x.tar.gz | tar xf -
2. cd apache_1.3.x
3. ./configure
4. cd ..

5. gunzip -c php-5.x.y.tar.gz | tar xf -
6. cd php-5.x.y
7. ./configure --with-mysql --with-apache=../apache_1.3.x
8. make
9. make install

10. cd ../apache_1.3.x

11. ./configure --prefix=/www --activate-module=src/modules/php5/libphp5.a
(The above line is correct! Yes, we know libphp5.a does not exist at this
stage. It isn't supposed to. It will be created.)

12. make
(you should now have an httpd binary which you can copy to your Apache bin dir if
it is your first install then you need to "make install" as well)

13. cd ../php-5.x.y
14. cp php.ini-dist /usr/local/lib/php.ini

15. You can edit /usr/local/lib/php.ini file to set PHP options.
Edit your httpd.conf or srm.conf file and add:
AddType application/x-httpd-php .php
更详细的说明见
http://php.chinaunix.net/manual/en/install.unix.php

NB: 

安装后如果运行mysqld_safe马上出现mysqld_ended,可从以下几方面考虑:

1.数据目录是否存在,传给mysqld_safe的用户参数是否有写数据目录的权限。

2.查看/etc/my.cnf,里面的路径是存在,注意.socket文件是否在用户可写的目录下。

3.查看mysqld_safe的运行日志(通常在数据目录里)。

如果安装后在别人的机子上打不开服务器上的网页,看看在/www/bin/apachectl start后是否出现

 [alert] httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
/www/bin/apachectl start: httpd started
如果是就说明/etc/hosts文件没写好,我的ip是202.117.10.55,所以我添上

202.117.10.55   dongjiajing
第二个域是计算机名,第三个域是别名(这里省略)



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值