环境:php-5.5+httpd-2.4+mysql-5.6
资源下载地址:(使用64位的资源)
php-5.5.34-Win32-VC11-x64
http://windows.php.net/download/#php-5.5
httpd-2.4.20-win64-VC11
http://www.apachelounge.com/download/VC11/
eclipse-php-helios-win32.win32.x86
http://www.eclipse.org/downloads/packages/eclipse-php-developers/heliosr
mysql-5.6.30-winx64
http://dev.mysql.com/downloads/mysql/5.6.html
0。做成eclipse的workspace目录
f:/pp/work
1。php配置
将php.ini-development 文件重命名为 php.ini
; extension_dir = "ext"
改成
extension_dir = "f:/pp/soft/php-5.5.34-Win32-VC11-x64/ext"
开启相应的扩展库,将下面的extension 前面的分号 “;” 去掉。
;extension=php_curl.dll
;extension=php_gd2.dll
;extension=php_mbstring.dll
;extension=php_exif.dll
;extension=php_mysql.dll
;extension=php_mysqli.dll
;extension=php_pdo_mysql.dll
;extension=php_pdo_odbc.dll
;extension=php_sockets.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
修正,
doc_root = F:/pp/work
2,apache配置
http.cnf
为避免监听端口重头,修正
Listen 8080
将
DocumentRoot "c:/Apache24/htdocs"
改成
DocumentRoot "f:/pp/work"
将
<Directory "c:/Apache24/htdocs">
改成
<Directory "f:/pp/work">
将
所有的c:/Apache24置换成自己解压的目录,例如f:/pp/soft/httpd-2.4.20-win64-VC11/Apache24
在文件的最后面加入,支持PHP5模块
# php5 support
LoadModule php5_module "f:/pp/soft/php-5.5.34-Win32-VC11-x64/php5apache2_4.dll"
AddType application/x-httpd-php .php .html .htm
# configure the path to php.ini
PHPIniDir "f:/pp/soft/php-5.5.34-Win32-VC11-x64"
3。启动
将apache添加到系统服务
cmd
f:/pp/soft/httpd-2.4.20-win64-VC11/Apache24/bin/httpd.exe -k install
net stop Apache2.4
net start Apache2.4
另外,需下载V11如果不安装的话会提示 msvcr110.dll丢失。
下载链接:
http://www.microsoft.com/zh-CN/download/details.aspx?id=30679
测试文件:index.php,请放到f:/pp/work目录下。
<?php
$connect=mysqli_connect("localhost","user","password");
if(!$connect) echo "Mysql Connect Error!";
else echo "mysql 连接成功";
mysqli_close();
phpinfo();
?>
浏览器,输入下面地址,查看结果。
http://localhost:8080/index.php
如提示错误,
Mysql Connect Error!
请修正:c:/Windows/System32/drivers/etc/hosts
将
# 127.0.0.1 localhost
改成(去掉#号)
127.0.0.1 localhost
参考资料:
http://www.cnblogs.com/tylerdonet/p/3789341.html
http://www.admin10000.com/Document/54.html
本文如有不正,请指出。
以上。
来源:oschina
链接:https://my.oschina.net/u/1050450/blog/663503