RedFlag6+apache,Windows2003Server+Apache PHP5 MYsql5环境配置

 

 

RedFlag6+apache2:

 

我用的软件版本及安装后的位置:

mysql客户端安装位置:  /usr/bin/mysql   MySQL-client-5.0.22-0.i386.rpm
PHP安装位置:             /usr/php-5.2.5RC1   php-5.2.6.tar.gz
mysql服务器:  /usr/share/mysql  MySQL-server-5.1.7-0.i386.rpm

apache:  /home/www/apache httpd-2.2.9.tar.gz

 

下载MySQL-devel.XXX.rpm  进行安装,这种安装方法很容易,不会安装的查下资料就可以了

 

您可能用到的安装及应用过程出出现问题的解决方法:


***查看你的系统有没有安装mysql header
   find / -name mysql.h***
安装mysql头后出现下面这个错误:
gcc: /usr/lib/mysql/libmysqlclient.so: No such file or directory
gcc: /usr/lib/mysql/libz.so: No such file or directory
解决方法:
删除  /usr/lib/mysql  下的所有.la文件
Deleting libmysqlclient.la and other .la files in the MySQL libraries directory
solves the problem.


显示mysql服务器和客户端的版本号:
rpm -qa|grep -i mysql
卸载mysql客户端和服务器端:
rpm -ev MySQL-server-5.1.7-0   MySQL-client-5.0.22-0
删除附加文件:
rm -f /etc/my.cnf  //配置文件
rm -rf /var/lib/mysql //数据库文件
更改用户密码:
./mysqladmin -u root password '123'
连接带密码的mysql登陆:
>mysql -u root -p
>password: 123
***./configure --prefix=/usr/local/mysql --sysconfdir=/etc --localstatedir=/var/lib/mysql --with-charset=gbk***


创建数据库表:
create table testuser
(
 userid int auto_increment primary key,
username char(20),
userpass char(20)
 );
插入数据:
insert into testuser (username,userpass) values('guigui','guigui');
insert into testuser (username,userpass) values('admin','admin');
导出数据库:
cd /usr/bin
mysqldump -u root -p guigui >/root/Desktop/guigui.sql
导入数据库:
mysql -u root -p
password:123
mysql>create database testin;
mysql>use testin;
mysql>source /root/Desktop/guigui.sql


apache安装:
1,下载
2,解压  tar -vxzf httpd-2.2.9.tar.gz
3,配置 ./configure --prefix=/home/www/apache --enable-so --enable-mods-shared=most
4, make
 make install
5,cd /home/www/apache/bin/
./apachectl start   //启动apache 服务
6,打开浏览器输入127.0.0.1 或  http://localhost   出现  it works  说明安装成功
7,把程序用为系统服务使其自动运行  
cp /usr/apache/bin/apachectl /etc/rc.d/init.d/httpd
 
卸载则删除   /home/sf/www/apache  中的所有内容
php的安装:
1,解压
2,./configure --with-apxs2=/home/www/apache/bin/apxs  --prefix=/home/www/php  --with-mysql=/var/lib/mysql/
 ./configure --with-apxs2=/home/www/apache/bin/apxs  --prefix=/home/www/php  --with-mysql=/usr/share/mysql   此句可以用
3,make
make install
4,cp   php.ini-dist   /usr/local/lib/php.ini
5,配置apache使其支持php
修改httpd.conf
LoadModule php5_module        modules/libphp5.so
AddType application/x-httpd-php .php .phtml
重启动计算机

 

注意:如果配置PHP安装的时候出现如下错误
configure: error: Cannot find MySQL header files under yes.
Note that the MySQL client library is not bundled anymore.

是因为安装的Mysql没有头文件

解决方法:

./configure --with-apxs2=/home/www/apache/bin/apxs  --prefix=/home/www/php  --with-mysql=/var/lib/mysql/

 

Windows2003Server+Apache  :操作比较容易因此说的不细请谅解

 

安装apache  mysql  对数据库做准备


配置Apache  使其能引入php模块: 
更改Apache配置文件httpd.conf如下

LoadModule php5_module "D:/php/php5apache2_2.dll" apache2应该调用此dll文件  
PHPIniDir "D:/PHP"

AddType application/x-httpd-php .php

将libmysql.dll复制到  apache安装目录/bin目录下

 重启动apache服务

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值