PHP环境搭建(Windows8.1+IIS8.5+PHP5.6+PHPStorm),windows8.1phpstorm
PHP环境搭建(Windows8.1+IIS8.5+PHP5.6+PHPStorm),windows8.1phpstorm
本随笔仅供初学者参考!作者:ShintoRuan ,转载注明出处:ShintoRuan
第一次接触php是在2014-5月份左右,当时是自己的主攻方向是C#,对php比较排斥, 其中很多一部分原因,就是PHP的断点调试一直无法配置成功,用echo打印日志的方式排错,使得自己对php心生怨恨,而错失了深入学习php的好机会。这次写这篇随笔,一方面是记录自己php方向的起航,另一方面也是希望能帮助刚接触php的初学者么,能够顺利的配置php的环境,而不至于对php产生恐惧。
一、系统环境简介
Windows系统是一个非常常见的系统。相信这里也不用多做解释。那么如何开启IIS(win8.1),其实网上已经有很多教程,我这里只做简单的介绍。
①安装.net fromework 3.5
IIS运行需要依赖.net3.5,因此第一步就是安装.net fromework3.5。安装方法大致有两种,一种是在线下载,速度非常慢(真的非常慢),这里给大家介绍第二种,离线安装.net fromework3.5。找到安装win8的iso文件,加载到虚拟光驱中,如果有刻U盘系统的插入U盘即可。运行 “命令提示符(管理员)”(右键桌面的Win图标),输入命令“dism.exe /online /enable-feature /featurename:NetFX3 /Source:V:\sources\sxs”,V盘表示虚拟光驱的盘符或U盘的盘符。
②开启IIS
做开发的,开启IIS应该是小case了。这里就不多说了。
二、预先工作
①环境及IDE等文件下载
以下为参考网址,如无法打开或变动,请自行搜索,获取最新版本文件请行搜索,以下链接版本日期:2015-4-29最新
PHP Manager:http://www.iis.net/downloads/community/2010/09/php-manager-for-iis-7
PHP:http://windows.php.net/download
XDebug:http://xdebug.org/
PHPStrom:http://www.jetbrains.com/phpstorm/
Xdebug Helper:http://www.chromein.com/crx_11294.html
②安装
初始的IIS是不支持php的,所以我们先下载了PHP Manager这个工具,安装成功后,可以在IIS中看到php manager的图标,如下图:
进入php manager。后续配置比较简单,请自行百度,本文文的重点是讲断点调试,所以就不多啰嗦了。php配置完成后会看到如下界面:
将下载下来xdebug的解压文件复制到php目录的ext文件夹中
接下来就是IDE的安装了,PHPStorm安装还是很简单的,这里也不做多说,Xdebug helper是Chrome的一个扩展工具,在浏览器中输入chrome://extensions/,然后将下载下来的crx文件拖入该页面就可以了。
三、配置
①Xdebug
Xdebug的配置网上一搜一大片,这里只给出我的配置,在php.ini文件中,加入以下代码,注意其中几个文件的位置。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
②PHPStorm
进入php设置
选择php语言设置
添加解释器,其实如果你在IIS中运行,是不用添加解释器的,不过如果直接通过phpstorm来打开你的php代码则需要添加解释器,如下,按Alt+F2。通过解释器运行php,是不需要安装IIS的
接下来就是配置phpStorm的debug了。其实phpstorm的debug基本都有默认设置了,但我们最好还是要修改一下,因为可能9000端口被其他应用占用了。所以我们需要更改为其他端口,例如9001
注意:这里的端口要与php.ini中xdebug中的端口配置一致,请看上面的配置代码。
1 |
|

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The differences between php5 and php8 are in terms of performance, language structure, type system, error handling, asynchronous programming, standard library functions and security. Detailed introduction: 1. Performance improvement. Compared with PHP5, PHP8 has a huge improvement in performance. PHP8 introduces a JIT compiler, which can compile and optimize some high-frequency execution codes, thereby improving the running speed; 2. Improved language structure, PHP8 introduces some new language structures and functions. PHP8 supports named parameters, allowing developers to pass parameter names instead of parameter order, etc.

How to change port 80 in php5: 1. Edit the port number in the Apache server configuration file; 2. Edit the PHP configuration file to ensure that PHP works on the new port; 3. Restart the Apache server, and the PHP application will start running on the new port. run on the port.

Solution steps for php5 not listening to port 9000: 1. Check the PHP-FPM configuration file; 2. Restart the PHP-FPM service; 3. Turn off the firewall or configure port forwarding; 4. Check whether other processes occupy port 9000.

The syntax differences between php7 and php5 are: 1. PHP7 introduces strict type declarations, while the type of PHP5 variables is implicit; 2. PHP7 introduces support for scalar type declarations, but PHP5 does not; 3. PHP7 introduces NULL Merge operator, while PHP5 checks whether a variable exists and is not null, you need to use a conditional statement; 4. PHP7 adds a new comparison operator "<=>", but PHP5 does not; 5. PHP7 introduces a new feature anonymous class , while PHP5 does not.

The differences between the version of php7 and 5 include performance improvements, scalar type declarations, return value type declarations, exception handling improvements, anonymous classes, syntax improvements, new operators, enhanced error handling and the removal of some old features. Detailed introduction: 1. Performance improvement. PHP7 introduces a new Zend engine, named Zend Engine 3.0, which brings significant performance improvement. The performance of PHP7 is approximately twice that of PHP5, mainly through improved memory management. , optimized function calls and exception handling, enhanced garbage collection, etc.

If you are a website administrator, you may encounter a situation where you need to change the PHP5 port from the default port 80. This process may be a little hurried, but as long as you follow the steps below, it will be easily completed.

When using PHP5, some users may encounter the situation that port 9000 cannot be listened to. At this time, we need to perform some configuration and troubleshooting work to solve this problem.

PHP is a widely used server-side programming language used to develop dynamic websites and applications. In recent years, the release of PHP7 has attracted some attention. PHP7 has many improvements and optimizations over previous versions (such as PHP5). In this article, we will explore the syntax differences between PHP7 and PHP5.
