php环境设置(win7)

转自 http://www.demohot.com/section/67

1配置php
访问php windows下载地址
http://windows.php.net/download#php-7.0
下载 VC14 x64 Thread Safe 这个zip包

2配置php调试支持xdebug
访问xdebug下载地址
https://xdebug.org/download.php
下载PHP 7.0 VC14 TS (64 bit) 这个dll文件

复制下载的php_xdebug-2.4.0-7.0-vc14-x86_64.dll文件到php-7.0.x/ext(你的php安装路径)
追加如下配置到php.ini中
xdebug.remote_enable=1
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
zend_extension="E:/server/php-7.0.6/ext/php_xdebug-2.4.0-7.0-vc14-x86_64.dll"
zend_extension配置xdebug的dll文件绝对路径


3安装配置apache-httpd
访问httpd的windows编译包
https://www.apachelounge.com/download/
下载httpd-2.4.20-win64-VC14.zip(适用于win64操作系统)
解压改zip包,默认为c盘根路径
这里将解压包中Apache24文件夹中的内解压到
E:\server\httpd-2.4.20 (自己定义的目录)
修改配置文件(如解压到c盘根目录,不需此步骤)
conf/httpd.conf
需要修改的几处

ServerRoot "c:/Apache24"

DocumentRoot "c:/Apache24/htdocs"
<Directory "c:/Apache24/htdocs">  
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

<IfModule alias_module>
    ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin/"
</IfModule>
<Directory "c:/Apache24/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>
改为解压httpd-2.4.20的路径
ServerRoot "E:/server/httpd-2.4.20"

DocumentRoot "E:/server/httpd-2.4.20/htdocs"
<Directory "E:/server/httpd-2.4.20/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

<IfModule alias_module>
    ScriptAlias /cgi-bin/ "E:/server/httpd-2.4.20/cgi-bin/"
</IfModule>
<Directory "E:/server/httpd-2.4.20/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>
apache httpd添加php支持
在httpd.conf配置文件中追加
##############
#php配置
##############
LoadModule php7_module "E:/server/php-7.0.6/php7apache2_4.dll"
AddHandler application/x-httpd-php .php
PHPIniDir "E:/server/php-7.0.6"
修改路径为你的php安装绝对路径

猜你喜欢

转载自tyymj.iteye.com/blog/2305465