[转载]Apache+PHP5+MySQL+phpMyAdmin安装攻略 | hdm58

更新:2018年07月11日 22:25 PHP 阅读(0)
标签: @Apache @MySQL @phpMyAdmin @PHP5 #作者: hdm58
1、安装配置PHP
2、安装Apach2
3、测试
4、安装MYSQL
到 www.jetdown.com 下载下面三种软件,做好安装准备
apache_2.0.47-win32-x86-no_ssl.msi 
mysql-4.0.14-win.zip 
phpMyAdmin-2.5.3-rc1-php.zip 
---------------------------------------------------------------------------------------------- 
PHP 5 Beta 2 http://snaps.php.net/win32/php5-win32-latest.zip size:5.87 MB (6,162,835 bytes) 
----------------------------------------------------------------------------------------------
<1>安装配置PHP 
1.解压缩PHP压缩包到C:\php\
2.复制C:\php\目录下的php4ts.dll及C:\php\dlls目录下的所有文件到windows安装目录的系统文件夹里 
(win9x/me是system目录,winNT,2k/winXP,2003是system32目录)
复制C:\php\php.ini-dist到windows安装目录下(如:c:\windows),并将其改名为php.ini。用记事本打开,修改一下信息: 
  搜索extension_dir = ./ 这行,并将其路径指到你的PHP目录下的extensions目录,比如: 
  extension_dir = C:\php\extensions
  如若想支持更多模块,,搜索: 
;Windows Extensions 
;Note that MySQL and ODBC support is now built in, so no dll is needed for it.
下面都用分号在前面注释掉了支持的扩展模块,如果你想PHP支持某个模块,请将前面的“;”去掉即可 
修改完成后,保存php.ini,到此完成PHP的安装和配置。 
我们在下面加入一行 
extension=php_mysql.dll
//Note 1: The extension dir need not be ".\", as Hermawan mentioned. It works fine for me with the extensions subdir where the other extensions are located.
//Note 2: The php.ini file need not be in the Apache root, as lars mentioned. It works fine for me in the Windows dir.
<2>安装Apach2 
1.备份 C:\Program Files\Apache Group\Apache2\conf\httpd.conf 文件。 
2.用记事本打开C:\Program Files\Apache Group\Apache2\conf\httpd.conf 
找到: 
#NameVirtualHost * 
修改为: 
NameVirtualHost 127.0.0.1 //或localhost 
找到: 
<VirtualHost 127.0.0.1> 
修改下面几行: 
ServerAdmin (你刚才安装时候输入的管理员信箱) 
DocumentRoot C:\Program Files\Apache Group\Apache2\htdocs 
ServerName Apache2 
ErrorLog C:\Program Files\Apache Group\Apache2\logs\error_log 
CustomLog C:\Program Files\Apache Group\Apache2\logs\access_log common 
</VirtualHost> 
找到: 
AddType application/x-tar .tgz 
在下面添加以下两行: 
AddType application/x-httpd-php .php 
AddType image/x-icon .ico 
找到: 
#LoadModule ssl_module modules/mod_ssl.so 
在下面添加一行: 
LoadModule php5_module C:\php\sapi\php4apache2.dll //这里php5_module是关键,如果php4_module apache就无法启动了 
增加默认文件: 
找到DirectoryIndex * 这行,可以这样修改,添加默认的文件名: 
DirectoryIndex index.php default.php index.htm index.html default.htm default.html 
保存文件,重起apache服务器。
最后,在该文件末尾加上下面两行 
ScriptAlias /php/ "c:/php/" 
Action application/x-httpd-php "/php/php.exe“
到此Apache的PHP环境已经完全建立了。
<3>测试: 
用记事本新建个文件,写下下面几行,保存到C:\Program Files\Apache Group\Apache2\htdocs目录下,这个目录就是你的站点跟目录,命名为phpinfo.php.然后在浏览器中输入http://localhost/phpinfo.php 就可以看到想尽的关于PHP的信息了。
phpinfo.php代码如下: 
<?php
phpinfo();
?>
<4>安装mysql
1.按默认安装在C:\mysql
Copy the following files to the Apache modules directory:
php\php4ts.dll 
php\sapi\php4apache2.dll 
php\dlls\iconv.dll
If any of these files are missing in the modules directory, Apache will fail to start.
Be sure the extension can find the following files:
php_mysql.dll 
iconv.dll 
libmySQL.dll
If any of them can't be found, Apache will start but will issue a warning like this: "Unknown(): Unable to load dynamic library 'c\php\extensions\php_mysql.dll" - The specified module could not be found."
php_mysql.dll should be in the extensions directory.
iconv.dll should be in the Apache modules directory.
libmySQL.dll must be either in the Apache root directory or the Windows system directory. I prefer the former because it's cleaner, as other applications don't necessarily use this MySQL library version.
Note 3: Be sure to use the libmySQL.dll file bundled with PHP. In my case, trying to use the libmySQL.dll from the MySQL 4.1 alpha package resulted in this error message: "Unknown(): Unable to load dynamic library 'c:\php\extensions\php_mysql.dll" - The specified procedure could not be found."
Start Apache and everything should be fine.
2.运行C:\mysql\bin\winmysqladmin.exe 设定user 和password 
3.运行mysql,测试一下 
mysql> show databases;
+-----------+ 
| Databases | 
+-----------+ 
| mysql | 
| test | 
+-----------+
如果出现以上画面,表明mysql已经安装成功;
感谢阅读本文,若本文对你有所帮助,不妨将其推荐给好友,与好友一起分享。
文章仅做学习交流使用,若您认为文章存在侵权或不合法行为等,请及时联系我们。
文章之版权归其合法拥者所有。转载原创内容无需联系本站站长,请注明原文出处及链接。
#原文:[IT技术网] http://www.173it.cn/view-127-1.html
更新:2018年07月11日 22:25 PHP 阅读(0)
标签: @Apache @MySQL @phpMyAdmin @PHP5 #作者: hdm58

阅读延伸

[转载]Mysql 工作原理 | Still water run deep

刚开始接触一个新的事物的时候,我觉得很有必要从其工作原理入手。
弄清楚这个东西的来龙去脉,为接下来的继续深入学习做好铺垫。
掌握好其原理有助于我们从整体上来把握这个东西,并且帮助我们在排错过程中理清思路。

[转载]Windows系统下PHP5和Apache的安装与配置 | hdm58

Windows系统下PHP5和Apache的安装与配置。
在这里以PHP5为例介绍一下Windows下Apache和PHP5的安装与配置方法。
标签: @windows @Apache @PHP5 @安装 @配置 PHP hdm58 05月02日 10:43 继续阅读

[转载]Apache+PHP5+MySQL+phpMyAdmin安装攻略 | hdm58

1、安装配置PHP
2、安装Apach2
3、测试
4、安装MYSQL
标签: @Apache @MySQL @phpMyAdmin @PHP5 PHP hdm58 05月02日 10:43 继续阅读