php+MYSQL运行环境的配置
安装步骤:
1.将压缩包解压到C:\PHP这个目录下.
2.将“C:\php\dlls”目录下的所有文件复制到“c:\WinNT\System32(Winodws98系统为C:\Windows\System)”目录下,有旧的文件存在就覆盖它。
3.将C:\PHP\php.ini-dist这个文件改名为PHP.ini,复制到“C:\WinNT(Winodws98系统为C:\Windows)”目录下,并修改里面的内容,具体如下:
找到“extension_dir = ”改为“extension_dir=c:/php/extensions”
再稍微往下看,改成这个样子:
;Windows Extensions
;Note that MySQL and ODBC support is now built in, so no dll is needed for it.
;
extension=php_bz2.dll
extension=php_ctype.dll
extension=php_cpdf.dll
extension=php_curl.dll
extension=php_cybercash.dll
extension=php_db.dll
extension=php_dba.dll
extension=php_dbase.dll
extension=php_domxml.dll
extension=php_dotnet.dll
extension=php_exif.dll
extension=php_fdf.dll
extension=php_filepro.dll
extension=php_gd.dll
extension=php_gettext.dll
;extension=php_ifx.dll
extension=php_iisfunc.dll
extension=php_imap.dll
extension=php_interbase.dll
extension=php_java.dll
extension=php_ldap.dll
extension=php_mhash.dll
;extension=php_mssql65.dll
extension=php_mssql70.dll
;extension=php_oci8.dll
extension=php_openssl.dll
;extension=php_oracle.dll
extension=php_pdf.dll
extension=php_pgsql.dll
extension=php_printer.dll
extension=php_sablot.dll
;extension=php_snmp.dll
;extension=php_sybase_ct.dll
extension=php_yaz.dll
extension=php_zlib.dll
如果哪个库在运行时不正常,就在行首加上分号“;”.
4.修注册表。(需要重新启动计算机才能生效)
在HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map
增加以下键值:
键名: ".PHP" 键值: "C:\php\php.exe %s %s"
5.点击"开始->程序->管理工具->Internet 服务管理器"打开"Internet 服务管理器",右击"默认Web站点->属性"打开"默认Web站点属性"窗口,在"ISAPI筛选器"配置页下,添加一个新的筛选器,筛选器名称为PHP,可执行文件为php4isapi.dll文件的完整路径,如C:\php\sapi\php4isapi.dll;在"主目录"配置页下,按"配置"按钮打开"应用程序配置"窗口,添加一个应用程序映射项,可执行文件为php.exe,文件的完整路径
如C:\PHP\php.exe,扩展名为.php(当然也可以改成别的,不过要注意您的PHP程序要以它为后缀哦),把"脚本引擎"打上勾,重新启动电脑及WWW服务。
三、测试PHP运行环境
在站点目录下写一个测试程序test.php,内容为
MySQL数据库系统的安装和配置
一、下载MySQL数据库(ODBC)驱动程序和MySQL数据库系统程序
1.MySQL数据库(ODBC)驱动程序下载地址为:http://mysql.com/Downloads/MyODBC/myodbc-2.50.36-nt.zip 、 http://download.sourceforge.net/pub...-2.50.36-nt.zip 或者 http://www.fykx.net/download/php/myodbc-2.50.36-nt.zip (1457KB)
2.MySQL数据库系统程序下载地址为:http://www.mysql.com/Downloads/MySQ...0-gamma-win.zip (9632KB)或者是 http://www.fykx.net/download/php/my...0-gamma-win.zip
二、程序安装
1.安装MySQL数据库(ODBC)驱动程序(Windows系统下必须安装)
2.安装MySQL数据库系统程序,一般安装在系统默认位置“C:\MySQL”,但要考虑你的服务器是否作为网络数据库服务器,如果要在此服务器上建立上百个数据库用户,就应该安装在空间比较大硬盘分驱上,以免今后不必要的麻烦和繁琐的设置。
三、程序的启动
执行“[系统安装盘符]:\MySQL\Bin\winmysqladmin.exe”这个程序来启动MySQL数据库系统和管理器,第一次启动时,系统会出现“快速设置”窗口,要求建立第一个数据库用户帐号,如下图。在User name中输入第一个MySQL数据库帐号的用户名,在Password中输入第一个MySQL数据库帐号的密码,最好你记住输入的值,然后进入MySQL数据库管理窗口,过一会儿程序自动最小化窗口到系统的托架处(任务栏的右边有个“红绿灯”图标),系统已经正常启动(Windows2000还要检查一下“组件服务管理器”中“MySQL组件服务”是否启动)。这时,程序还在启动组里添加了一个快捷方式,下次启动计算机就自动启动MySQL数据库系统。
四、数据库的建立
第一次启动数据库,系统就自动建立了名称为MySQL和test的两个数据库,你可以用以下的方法建立其它名称的数据库:
右键单击系统托架“红绿灯”图标=>>单击“Show me”打开MySQL数据库管理窗口=>>选择“Databases”标签=>>选择数据库服务器=>>右键单击一下=>>选择“Create database”菜单项=>>在弹出的添加数据库对话框中键入数据库名称(Database name)=>>单击“Create the datebase(创建这个数据库)”,一个新的数据库就建立了。如下图
五、数据库用户帐号管理
第一次启动数据库就建立了一个数据库用户帐号,如果你的服务器要让多个用户使用的话,就必须建立多个数据库用户帐号,步骤如下:
启动“ODBC 数据源管理器”(WindowsNT系统下“ODBC 数据源管理器”在“管理工具”里,Windows98 or Me系统下“ODBC 数据源管理器”在“控制面板”里)=>>在第一个标签“用户DSN”中单击“添加”按钮=>>在数据源驱动程序列表中选择“MySQL”=>>单击“完成”按钮=>>在“数据库驱动程序配置”对话框“Windows DSN name”中填入“动感教育网”(表示为动感教育网开的帐号),在MySQL host(Name or IP)填入服务器的主机名或者IP地址,在MySQL database name中填入数据库名称,在User中填入数据库帐号的用户名,在Password中填入数据库帐号的密码,其它的为默认设置=>>单击“OK”。一个新的数据库帐号就建立起来了。
六、调试程序(以版面风格美化后的vBulletin Version 1.1.5 中文标准版为代理例)
1.修改Admin/Config.php文件,具体内容如下:
// 目前只支持MySQL
$dbservertype="mysql";
// hostname或服务器ip
$servername="localhost";
// 登录数据库的用户名和密码
$dbusername="xiaozhang";
$dbpassword="123456";
// 数据库名
$dbname="mysql";
//允许在控制面板查看/编辑密码
// 0 = 不可见或编辑
// 1 = 不可见,但可以编辑
// 2 = 可见和可以编辑
$pwdincp=2;
?>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

One of the major changes introduced in MySQL 8.4 (the latest LTS release as of 2024) is that the "MySQL Native Password" plugin is no longer enabled by default. Further, MySQL 9.0 removes this plugin completely. This change affects PHP and other app

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

Validator can be created by adding the following two lines in the controller.

CakePHP is an open source MVC framework. It makes developing, deploying and maintaining applications much easier. CakePHP has a number of libraries to reduce the overload of most common tasks.
