一、尤其desktop0.3少一些文件,先要安装lib
xml2-dev php4-domxml flex libcurses5-dev libg++2.8.1.3-glibc2.2 glibc libg++27 libstdc++ termcap-compat
可能有些是不要的,我是回忆出来的
二、准备安装
将所有软件的源代码放置在目录 /home/src 下 ,安装目录为 /server ,下载后的源代码包在/files目录下,故执行以下操作:
mkdir /home/src
mkdir /server
groupadd mysql
useradd -g mysql -d /home/mysql mysql //建立mysql组及用户
cd /home/src
tar zxvf /files/mysql-4.0.21.tar.gz
tar zxvf /files/httpd-2.0.52.tar.gz
tar zxvf /files/php-5.0.2.tar.gz
tar zxvf /files/ZendOptimizer-2.5.5-Linux_glibc21-i386.tar
三、安装配置过程
使用 vi 编辑一 shell 文件,内容如下: (复制并编辑一个脚本文件,内容如下)
-----------------------------------
#!/bin/sh
cd /home/src/mysql-4.0.21
./configure --prefix=/server/mysql
make
make install
/server/mysql/bin/mysql_install_db
chown -R root /server/mysql
chgrp -R mysql /server/mysql
chown -R root /server/mysql/bin
chgrp -R mysql /server/mysql/bin
chown -R root /server/mysql/var
chgrp -R mysql /server/mysql/var
chmod 777 /server/mysql/var
chown -R root /server/mysql/var/mysql
chgrp -R mysql /server/mysql/var/mysql
chmod 777 /server/mysql/var/mysql
chown -R root /server/mysql/var/mysql/*
chgrp -R mysql /server/mysql/var/mysql/*
chmod 777 /server/mysql/var/mysql/*
chmod 777 /server/mysql/lib/mysql/libmysqlclient.a
#安装 mysql-4.0.21
cd /home/src/httpd-2.0.52
./configure --prefix=/server/apache --enable-so
make
make install
#安装 httpd-2.0.52
cd /home/src/php-5.0.2
./configure --with-mysql=/server/mysql --with-apxs2=/server/apache/bin/apxs \
--enable-track-vars --enable-force-cgi-redirect --enable-pic \
--enable-inline-optimiation --enable-memory-limit --enable-bcmath \
--enable-shmop --enable-versioning \
-enable-calendar --enable-dbx --enable-dio --enable-mcal \
--with-config-file-path=/server/apache/conf
make
make install
cp php.ini-dist /server/apache/conf/php.ini
#安装php-4.3.1 ,以上某些模块可不使用,--with-config-file-path=/server/apache/conf 指定
#php的配置文件在目录 /server/apache/conf
ln -s /server/apache/bin/apachectl /bin/apache
ln -s /server/mysql/bin/mysql /bin/mysql
#创建符号连接
----------------------------------------------------
四、修改配置文件
vi /server/apache/conf/httpd.conf
# 加入以下行(装载php45块并指定.php 文件)
# LimitRequestBody (指定php处理的请求数据大小,以下指定为 20M)
LoadModule php5_module modules/libphp5.so
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 20971520
#注解以下行(在文本前加#),使apache显示中文,具体原因未知
ForceLanguagePriority Prefer Fallback
AddDefaultCharset ISO-8859-1 改为AddDefaultCharset gb2312
#支持后缀为 .php .php3的文件
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
#加入默认的引导文件index.php(找到DirectoryIndex,修改如下:)
DirectoryIndex index.html index.html.var index.php
#指定网站目录(假设为 /apache 目录)
DocumentRoot "/apache"
vi /server/apache/conf/php.ini
#找到并修改以下参数
max_execution_time = 600 ;最大运行时间 600 秒
max_input_time = 600 ;最大输出时间 600秒
memory_limit = 20M ;最大内存限制 20M
file_uploads = On ;允许上载文件
upload_max_filesize = 20M ;最大文件大小 20M
post_max_size = 20M ;php可接受的 post 方法大小 20M
session.auto_start = 1 ;session自动启动
register_globals = Off 改为 register_globals = On
=================================================
vi /server/apache/conf/mime.type
#添加文件类型
application/x-httpd-php .php .phtml
五、运行
#启动mysql
/server/mysql/bin/safe_mysqld --user=mysql &
#停止mysql
/server/mysql/bin/mysqladmin shutdown
#启动apache
apache start
#停止apache
apache stop
mkdir /apache
echo "/apache/index.php
echo "phpinfo();" >>/apache/index.php
echo "?>" >>/apache/index.php
#生成/apache/index.php 文件
在浏览器上输入 linux 机器网址,php 的配置信息将显示出来。
参考:http://www.linuxsir.org/bbs/showthread.php?s=f63e463e61fc115efccf049a5dc8d728&threadid=34413&perpage=15
本文地址:http://com.8s8s.com/it/it32292.htm