在这个 网址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
第二个域是计算机名,第三个域是别名(这里省略)
下载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,所以我添上
第二个域是计算机名,第三个域是别名(这里省略)