linux软件安装(mysql+apache+php)
所需软件
php4.03.tar.gz源程序 C语言代码
mysql3.23 alpha.tar.gz源程序
httpd 1.3.11.tar.gz源程序
phpmyadmin_2.0.5.tar.gz 管理MYSQL数据库的最佳工具
mysql是rpm安装,php安装在/server/php下,httpd安装在/server/apache下
第一步 下载所需程序,安装MYSQL3.23程序。
gzip -d 包名.gz
tar -xvf 包名.tar
用以上命令进行解压
系统必需已安装C开发库
(
?# ./configure
? --with-apxs2=/usr/local/Apache/bin/apxs
? --disable-debug #关闭PHP内部调试
? --enable-safe-mode #打开PHP的安全模式
? --enable-trans-sid
? --with-xml ???#支持xml
? --with-Mysql?#支持Mysql
? --enable-short-tags #支持PHP的短标记
? --with-gd ???#支持GD库
? --with-zlib ???#支持zlib
? --with-jpeg ??
? --with-png
? --enable-memory-limit
? --disable-posix
? --with-config-file-path=/usr/local/lib
)
--------------------------------------
mysql安装
./configure -help
./configure -prefix=/server/mysql
make
make install
cd /server/mysql/bin
./mysql_install_db
到这mysql已安装成功
可以运行mysql数据库
/server/mysql/libexec/mysqld &
可以通过数据库查看程序mysqlshow查看数据库当前的状态
/server/mysql/bin/mysqlshow
-------------------------------------------
再安装libxml,在red hat linux
libxml2-2.6.30.tar.gz
./configure
make
make install
---------------------------------------
安装apache及php4。
如果系统中已有apache运行先关闭此服务
killall httpd
编译apache及php4, 每一个行号为一行
//apache
cd /root/wuquanyindir/phpdir/httpd*//进入apache目录下
./configure --prefix=/server/apache//安装时所存放的路径
make
make install
--------------------------------------------
//php
cd /root/wuquanyindir/phpdir/php*//进入php目录
./configure --with-mysql=/server/mysql --with-apache=../httpd* --enable-track-vars
(如果是rpm安装的mysql
./configure --prefix=/server/php --with-apxs=/server/apache/bin/apxs --with-config-file-path=/usr/local/lib --enable-track-vars --with-xml --with-MySQL
?
)
make
make install
-----------------------------------------------------
cd /root/wuquanyindir/phpdir/httpd*//进入apache目录下
./configure --prefix=/server/apache --activate-module=src/modules/php4/libphp4.a
make
make install
-------------------------------------------------------
cd ../php-4.0.x
cp php.ini-dist /usr/local/lib/php.ini
apache及php4已安装成功下面配置apache及php4
-------------------------------------------------------
配置php4
php4的配置文件为/usr/local/lib/php.ini文件
可以用vi 来编辑,如果你安装了MC也可以用MC来编辑
在[mysql]下修改
mysql.default_port = 3306
mysql.default_host = localhost
mysql.default_user = root
保存文件。
-----------------------------------------------
配置apache
apache的配置文件为/server/apache/conf/httpd.conf
去掉
#AddType application/x-httpd-php .php
行的注册号"#"加入行
AddType application/x-httpd-php .php3
保存文件。
----------------------
配置phpmyadmin_2.0.5
在/server/phpmyadmin_2.0.5下找到config.inc.php3文件 从第10行起修改如下
$cfgServers[1]['host'] = 'localhost';
$cfgServers[1]['port'] = '3306';
$cfgServers[1]['adv_auth'] = false;
$cfgServers[1]['stduser'] = 'root';
$cfgServers[1]['stdpass'] = '';
$cfgServers[1]['user'] = 'root';
$cfgServers[1]['password'] = '';
$cfgServers[1]['only_db'] = '';
$cfgServers[1]['verbose'] = '';
修改第65行
require("english.inc.php3");为
require("chinese_gb.inc.php3");
保存此文件。
启动apache
/server/apache/bin/apachectl start
第三步测试
在/server/apache/htdocs/下链接目录/server/phpMyAdmin_2.0.5为admin
在流览器中打开http://localhost/admin/index.php3?这时该能连接到MYSQL的数据库中,你可以对数所库进行操作。这表明整个系统以能正常工作。 你也可以新建立一个php文件如下
文件名 info.php
-------------------------------------可看该网站的安装-----------------------------------
http://hi.baidu.com/52hack/blog/item/bba9bb1c848f438386d6b670.html