当前位置:  开发笔记 > 编程语言 > 正文

配置最新的PHP加MYSQL服务器

配置最新的PHP加MYSQL服务器,阅读配置最新的PHP加MYSQL服务器,通过一个小时的研究和设置.实现了最新的PHP5.0+MYSQL5.0+WIN2003.个人认为还是有必要写个教程出来.因为很多方面和老版本的不尽相同.说实话自己也是查阅了很多官方文档才解决了很多怪异问题">

通过一个小时的研究和设置.实现了最新的 PHP 5.0 + MYSQL 5.0 + WIN2003.
个人认为还是有必要写个教程出来.因为很多方面和老版本的不尽相同.
说实话自己也是查阅了很多官方文档才解决了很多怪异问题.

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

相关软件均可以在 下载.

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岁至今未婚.

到这里.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

相关官方技术资料:

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:

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.

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

到这里应该就没有很大问题了.如果有配置基础的朋友应该完全可以理解了.
本人在实际配置的时候也遇到了很多问题.最后都是耐心查询官方文档得到了解决.


推荐阅读
  • 导读:今天编程笔记来给各位分享关于php动态扩展怎么加载的相关内容,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!本文目录一览: ... [详细]
  • 我使用Laravel5时遇到问题.当我运行“phparitsanmigrate”时,我收到了这个错误***************************************A ... [详细]
  • CentOS8.4 安装PHP7.4.25
    1、下载官网:https:www.php.netdownloads#cdmydata#wgethttps:www.php.netdistributionsphp ... [详细]
  • 后端开发|php教程public,function,protected,mdash,Jordan后端开发-php教程周五了啦啦啦啦-LAMP+PHP‘sOOP部门信息管理系统asp ... [详细]
  • 代码:在mysql5.6,运行正常,5.7报错SELECTsum((selecta.numwherea.status1))astotalFROMmes_order_productA ... [详细]
  • 【自制小工具】代码生成器
    【自制小工具】代码生成器陆陆续续接触过好几款代码生成工具,发现确实好用,但都会有那么点不完善的地方,所以索性就自己做一个吧。界面非常简单,反正是自己用的,简单点用起来也方便上图:左 ... [详细]
  • kepserver中文手册,kepserver使用教程,kepserver设置
    下面介绍一下KepServer模拟器的使用,以下示例使用服务器随附的Simulator驱动程序来演示创建、配置和运行项目的过程。Simulator驱动程序是基于内存的驱动程序,能为 ... [详细]
  • ApacheTrafficServer6.2.2发布了,TrafficServer是一套快速、模块化 ... [详细]
  • delphi控件大全
    本文章已收录于:delphi控件查询:http:www.torry.nethttp:www.jrsoftware.orgTb97最有名的工具条(ToolBar) ... [详细]
  • vscode里的html标签导航的一系列问题
    哈喽,我今天带来的经验是,vscode在18年10月更新后的1.29以后,编辑html文档时,会发现最上面有个类似于HTML标签导航的玩意儿,可能部分同学和我一样不习惯用它们,现在 ... [详细]
  • Illustrator绘制逼真的愤怒的小鸟实例教程
    Illustrator教程: ... [详细]
  • 抓取百万知乎用户设计之实体设计
    一.实体的关系实体是根据返回的Json数据来设计的教育经历方面用户可以有很多教育经理,USER和education是一对多的关系,一个education对应一个education一 ... [详细]
  • iOS之富文本
    之前做项目时遇到一个问题:使用UITextView显示一段电影的简介,由于字数比较多,所以字体设置的很小,行间距和段间距也很小,一大段文字挤在一起看起来很别扭,想要把行间距调大,结 ... [详细]
  • jquery popupDialog 使用 加载jsp页面办法
    php教程|PHP开发jqueryphp教程-PHP开发如下所示:软件市场源码,vsCode字体不变,ubuntu的所有版本,taotomcat,sqlite连接php,个人域名服 ... [详细]
  • Shiro 简单了解
    Shiro简单了解简单用过SpringSecurity安全框架后,再试试另一个安全框架——Shiro。1.Shiro简介ApacheShiro是一个强大且易用的Java安全框架:S ... [详细]
author-avatar
北关仔仔_378
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有