Home  >  Article  >  Backend Development  >  PHP开发环境搭建(phpstorm + xampp+mongodb)

PHP开发环境搭建(phpstorm + xampp+mongodb)

WBOY
WBOYOriginal
2016-06-23 13:22:00918browse

phpstorm 安装下载       百度网盘资源 phpstorm 9.0.1(有序列号)   http://pan.baidu.com/s/1kTvX0jl

xampp 安装下载          百度网盘资源xampp_win32_5.6.14            http://pan.baidu.com/s/1eQ6rdRW

mongodb安装下载         百度网盘资源                              http://pan.baidu.com/s/1c00p1hI

 

php环境变量配置:

新建一个系统变量(右键计算机 选择属性->高级->环境变量->新建):变量名:PHP_HOME  变量值: 安装xampp的路径\xampp\php 

编辑path变量(右键计算机 选择属性->高级->环境变量->选择path->编辑)加上 ;%PHP_HOME%;%PHP_HOME%\ext

 

PHP mongodb 扩展安装配置:

我的PHP版本是5.6.14 ,相对应的是php-mongo-1.6.8-5.6-vc.dll  

百度网盘php-mongo各个版本文件 http://pan.baidu.com/s/1o6vlxfO 请选择适合自己系统和PHP版本的扩展下载

将其重命名为php-mongo.dll 然后放入xampp/app/ext

并在php.ini文件(一般可在\xampp\php\文件夹下找到php.ini,记事本就可打开)的对应位置添加 extension = php_mongo; 如下图:

 

如果php-mongo版本与你的php不对应,命令行输入php -version会出现下图结果:

 

成功安装应该是

 

启动apache:

 

如果没有用到mysql 可以只启动apache。启动后在浏览器输入localhost回车后可以看到apache的页面

 

然后就可以在phpstorm写你的php了

如果打开php页面出现了502 bad gateway, phpstorm会提醒你configured PHP Interpreter ,按照提醒配置你的php解释器就可以了,如下图:

若还是会出现502 bad gateway,可以打开apache>conf>apache(httpd.conf)进行配置,如下图:

 

找到DocumentRoot 和,将DocumentRoot 和设置为你项目的目录。

DocumentRoot "你的项目位置如 E:/project/engineering/src/web/portal/InfoMask/web"

 

刚学php不久,这是我配置php环境的过程,有说错的地方望指教~

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn