转至繁体中文版     | 网站首页 | 图文教程 | 资源下载 | 站长博客 | 图片素材 | 武汉seo | 武汉网站优化 | 
最新公告:     敏韬网|教学资源学习资料永久免费分享站!  [mintao  2008年9月2日]        
您现在的位置: 学习笔记 >> 图文教程 >> 数据库 >> MySql >> 正文
配置最新的PHP加MYSQL服务器         ★★★★

配置最新的PHP加MYSQL服务器

作者:闵涛 文章来源:闵涛的学习笔记 点击数:725 更新时间:2009/4/22 20:49:02
相信大家通过 GOOGLE.COM 和经典的N多教程应该非常熟悉去架设PHP+MYSQL服务器.
本人最近无聊.所以去 WWW.SKYCN.NET 下载了最新的 MYSQL 5.0 以及 PHP 5.0
通过一个小时的研究和设置.实现了最新的 PHP 5.0 + MYSQL 5.0 + WIN2003.
个人认为还是有必要写个教程出来.因为很多方面和老版本的不尽相同.
说实话自己也是查阅了很多官方文档才解决了很多怪异问题.

=========================

相关软件均可以在 WWW.SKYCN.NET 下载.

MYSQL 5.0 FOR WINDOWS
PHP 5.0 FOR WINDOWS
PHPMYADMIN
WINDOWS SERVER 2003

=========================

首先安装 MYSQL .本来以为新版本的安装界面应该会花哨点.
但是仍然只看到老土的海豚.除了安装时间比 4.0 长.当然咯.因为 5.0 比 4.0 体积大很多.

推荐安装在独立的 NTFS 分区上.比如我服务器的 F盘.只放服务器软件.
路径为: F:\MYSQL\

然后进入 F:\MYSQL\BIN\ 鼠标双点 winmysqladmin.exe
首次运行会提示输入超级用户和密码.就输入 root 密码 root
注意啊.如果是对外服务器请设置超级复杂.比如 Wjwsfjn29szjwh~mysql
翻译过来就是: 我叫魏舒芬.今年29岁至今未婚. :D

到这里.MYSQL就安装完毕了.如果不明白请参看深空同学的相关文章.

=========================

下面安装 PHP 5.0 其实没什么安装不安装的.解压缩文件.推荐放到
路径为: F:\PHP\

到这里就应该进入关键步骤了.
首先复制 PHP 目录下的 Php.ini-dist 到 C:\Windows\ 并将文件名修改成为 Php.ini

COPY F:\PHP\Php.ini-dist C:\Windows
Ren Php.ini-dist Php.ini

如果是 WINDOWS 2000 就是: C:\WINNT\
如果是 WIN9X / 2003 就是: C:\Windows\

然后复制 PHP 目录下 DLLS 目录里的所有文件到 SYSTEM32 目录.(全部用的到吗?有些是没用的除非你打开)

COPY F:\PHP\dlls\*.* C:\Windows\System32\

如果是 WINDOWS 2000 就是: C:\WINNT\System32\
如果是 WIN9X / 2003 就是: C:\Windows\System32\

继续.复制PHP目录下 php4ts.dll 文件到 System32 目录里.

COPY F:\PHP\php4ts.dll C:\Windows\System32\

=========================

到这里复制工作全部完成.下面修改 C:\Windows\Php.ini 文件.

请注意.5.0的版本修改与4.0并不完全相同.需要注意的如下.

查找 extension_dir 字串.修改为你 PHP 目录里 extensions 的路径.

; Directory in which the loadable extensions (modules) reside.
extension_dir = F:\PHP\extensions   (有些是EXT文件夹。。改下就好)

相关官方技术资料:

Edit your php.ini file:

You will need to change the ''''extension_dir'''' setting to
point to your php-install-dir, or where you have placed
your ''''php_*.dll'''' files. ex: c:\php

If you are using OmniHTTPd, do not follow the next step.
Set the ''''doc_root'''' to point to your webservers
document_root. ex: c:\apache\htdocs or c:\webroot

Choose which extensions you would like to load when PHP
starts, noting that several extensions are already built
into the Windows release, see the section about
Windows extensions for details of the built-in extensions.
You can uncomment the: ''''extension=php_*.dll'''' lines
in php.ini to load these extensions.

Note that on a new installation it is advisable to first get
PHP working and tested without any extensions before enabling
them in php.ini.

On PWS and IIS, you can set the browscap.ini
to point to: ''''c:\windows\system\inetsrv\browscap.ini'''' on
Windows 9x/Me and ''''c:\winnt\system32\inetsrv\browscap.ini''''
on NT/2000/XP Server.

More information on the capabilities of browscap can be found here:

www.php.net/manual/en/function.get-browser.php

Note that the mibs directory supplied with the Windows distribution
contains support files for SNMP. This directory should be moved to
DRIVE:\usr\mibs (DRIVE being the drive where PHP is installed.)

然后与 PHP 4.0 不同的是.需要修改 Php.ini 文件里的如下内容:
查找 cgi.force_redirect 字串.默认值为1.将其修改为0.并取消前面的;号.

即:

; cgi.force_redirect is necessary to provide security running PHP as a CGI under
; most web servers. Left undefined, PHP turns this on by default. You can
; turn it off here AT YOUR OWN RISK
; **You CAN safely turn this off for IIS, in fact, you MUST.**
cgi.force_redirect = 0

切记如上修改的地方.否则PHP 5.0是无法运行的.会有如下提示.

Security Alert! The PHP CGI cannot be accessed directly.

相关官方技术资料:

!NOTE!: Since 4.1.2, the php.ini setting cgi.force_redirect defaults to ''''1''''
which effectively prevents the cgi from working within IIS. You need to set
up at least a minimal php.ini file with the following directive:

cgi.force_redirect = 0

If it doesn''''t work immidiately, make sure you have the php.ini file in the
right place (%SYSTEMROOT%\php.ini).

接下来修改 Php.ini 文件关于 MYSQL 5.0 的设置.

查找 [MySQL] 字段内的内容.修改如下.

mysql.default_port = 3306
// 这里是MYSQL的端口.

mysql.default_host = localhost
// 这里是本地主机.

mysql.default_user = root
// 这里是用户

mysql.default_password = Wjwsfjn29szjwh~mysql (如果自己测试。其实空密码就好)
// 这里是密码

修改到这里就可以让 Php 与 MYSQL 关联了.
最后启动 PHP 对 MYSQL 模块支持.

查找 extension=php_mysql.dll 字串.删除掉前面的 ; 号(这里是关键点)

extension=php_mysql.dll

请注意.如果不启动 PHP 对 MYSQL 模块支持.将无法使 PHPMYADMIN 正常工作.将提示:

cannot load MySQL extension, please check PHP Configuration
无法装入 MySQL 扩展,请检查 PHP 的配置。

相关官方技术资料:

To connect to a MySQL server, PHP needs a set of MySQL functions called "MySQL extension".
This extension may be part of the PHP distribution (compiled-in), otherwise it needs to be loaded dynamically.
Its name is probably mysql.so or php_mysql.dll. phpMyAdmin tried to load the extension but failed.

=========================


[网络技术]PPTP服务器的端口  [MySql]PHP存取 Mysql 数据乱码终极解决方案
[MySql]解决Table xxx is marked as crashed and should …  [MySql][MySQL]快速解决"is marked as crashed and shoul…
[MySql]MySQL DELETE语法用法详解  [MySql]mysql中时间日期格式化
[C语言系列]Socket 编程,一个服务器,多个客户端,互相通信  [MySql]修改mysql导入文件大小限制
[其他]MySql常用命令大全  [Web开发]把ACCESS的数据导入到Mysql中的方法详解
教程录入:mintao    责任编辑:mintao 
  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      注:本站部分文章源于互联网,版权归原作者所有!如有侵权,请原作者与本站联系,本站将立即删除! 本站文章除特别注明外均可转载,但需注明出处! [MinTao学以致用网]
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

    同类栏目
    · Sql Server  · MySql
    · Access  · ORACLE
    · SyBase  · 其他
    更多内容
    热门推荐 更多内容
  • 没有教程
  • 赞助链接
    更多内容
    闵涛博文 更多关于武汉SEO的内容
    500 - 内部服务器错误。

    500 - 内部服务器错误。

    您查找的资源存在问题,因而无法显示。

    | 设为首页 |加入收藏 | 联系站长 | 友情链接 | 版权申明 | 广告服务
    MinTao学以致用网

    Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved.
    闵涛 投放广告、内容合作请Q我! E_mail:admin@mintao.net(欢迎提供学习资源)

    站长:MinTao ICP备案号:鄂ICP备11006601号-18

    闵涛站盟:医药大全-武穴网A打造BCD……
    咸宁网络警察报警平台