电脑技术学习

Windows环境下PHP5开发配置指南

dn001

Windows环境下PHP5开发配置指南

开发平台:
WindowsXP + php-5.1.6-Win32 + mysql-5.0.18-win32
+ Smarty-2.6.14 + Date-1.4.6.tar + DB-1.7.6.tar + MDB2-2.3.0.tar + Validate-0.6.5.tar + DB_DataObject-1.8.4.tar
工具:
phpMyAdmin-2.9.0.2
--<目次>—

一、;PHP的安装与配置;3
1、;PHP5的下载和安装;3
2、;配置PHP;3
二、配置IIS服务器;3
三、;phpMyAdmin的配置;4
1、;新建WEB虚拟目录;4
2、;解压缩。;4
3、;配置;4
4、测试;4
四、;smarty的配置;4
1、;安装;4
2、;配置;4
3、测试;5
五、;DataObject的配置;5
1、;下载;5
2、;安装;6
3、;配置;6
4、;测试;7


一、PHP的安装与配置

PHP配置步骤
1、PHP5的下载和安装
将解压缩后的php-5.1.6-Win32中的文件拷贝到C://php5/下面。
2、配置PHP
复制 C:\PHP5\目录下的 php5ts.dll 文件到c:\winnt\system32目录中。
将C:\PHP5\目录下的php.ini-recommended文件拷贝到c:\WINDOWS中,并改名为php.ini。
注意:如果使用了 NTFS,确保运行 webserver 的用户对 php.ini 有读取的权限(例如使其对 Everyone 可读,即将c:\WINDOWS设置为WEB共享)。
以下正确加载对MySQL数据库等的支持模块。
复制 C:\PHP5\ 目录下的libmysql.dll文件到 C:\windows\system32\ 目录中。
用记事本打开编辑php.ini文件,找到并修改下面两行:
; Directory in which the loadable extensions (modules) reside.
extension_dir = "./"
改成:
; Directory in which the loadable extensions (modules) reside.
extension_dir = "c:\php5\ext\"
再找到下面两行:
;Windows Extensions
;Note that ODBC support is built in, so no dll is needed for it.
将; extension=php_mbstring.dll
;extension=php_mysql.dll
; extension=php_gd2.dll

前的分号去掉,然后保存文件并退出。

二、配置IIS服务器
依次点击“开始/设置/控制面板/管理工具/Internet服务管理器/主目录。
在“主目录中点击“配置按钮,在应用程序映射中添加一个新的条目。用 php5isapi.dll 的路径作为可执行文件(Executable),用 .php 作为文件后缀。
其实,就是在默认站点下建立虚拟目录:命名为test,指向D:\www\test。 (请记住,这个目录很重要,下面的配置要用到。)
如果你不用 PHP 进行 HTTP 认证的话,你可以不设置ISAPI筛选器。
完全停止 IIS 服务,再重新启动IIS服务。如果还是出现问题,则重新启动电脑。

三、;phpMyAdmin的配置
1、;新建WEB虚拟目录
新建WEB虚拟目录phpMyAdmin指向D:\www\phpMyAdmin。
2、;解压缩。
将解压缩的phpMyAdmin-2.9.0.2文件夹中的所有文件拷贝到该目录下。
3、;配置
将该目录下的config.sample.inc.php文件改名为config.inc.php。并用记事本打开编辑以下项目:
$cfg['PmaAbsoluteUri'] = 'http://localhost/phpMyAdmin/';
$cfg['Servers'][$i]['host']; = 'localhost';
$cfg['Servers'][$i]['port']; = ''
$cfg['Servers'][$i]['socket'];;;;;= ''
$cfg['Servers'][$i]['connect_type']; = 'tcp';;;;;
$cfg['Servers'][$i]['extension'];;= 'mysql';;;
$cfg['Servers'][$i]['compress'];;;= FALSE;
$cfg['Servers'][$i]['controluser']= ''
$cfg['Servers'][$i]['controlpass']= '';
$cfg['Servers'][$i]['auth_type'];;= 'cookie';
$cfg['Servers'][$i]['user']; = 'root';;;;// MySQL user
$cfg['Servers'][$i]['password'];;;= 'rootroot'// MySQL password (only needed)
4、测试
开启浏览器,输入http://localhost/phpMyAdmin/

标签: