Table of Contents
Building a PHP5.6 environment under WIN8.1
Home Backend Development PHP Tutorial Building a PHP5.6 environment under WIN8.1_PHP tutorial

Building a PHP5.6 environment under WIN8.1_PHP tutorial

Jul 13, 2016 am 09:55 AM
win8.1

Building a PHP5.6 environment under WIN8.1

Many people like to use Linux to build a PHP web language running environment, but because Linux is highly customized, root is often required The running command is slightly high-end and corresponds to Microsoft's Windows operating system. The user experience is good. You can use the IIS component PHP package that comes with Windows to build a suitable operating environment.

The first time I came into contact with PHP was around 2014-May. At that time, my main focus was C#, and I was quite repulsive to PHP. Part of the reason was that PHP's breakpoint debugging could not be configured successfully. I used echo to print the log. The method of debugging made me resentful of PHP and missed a good opportunity to learn PHP in depth. I am writing this essay this time, on the one hand, to record my departure in the direction of PHP, and on the other hand, I hope to help beginners who are new to PHP, so that they can smoothly configure the PHP environment without fear of PHP.

1. Introduction to system environment

Windows system is a very common system. I believe there is no need to explain more here. So how to open IIS (win8.1), there are actually many tutorials on the Internet, I will only give a brief introduction here.

 ①Install .net fromework 3.5

IIS operation depends on .net3.5, so the first step is to install .net fromework3.5. There are roughly two installation methods. One is online downloading, which is very slow (really very slow). Here I will introduce to you the second one, offline installation of .net fromework3.5. Find the iso file for installing win8 and load it into the virtual optical drive. If you have a USB flash drive system, just insert the USB flash drive. Run "Command Prompt (Administrator)" (right-click the Win icon on the desktop) and enter the command "dism.exe /online /enable-feature /featurename:NetFX3 /Source:V:sourcessxs". The V drive represents the drive letter of the virtual optical drive. Or the drive letter of the USB flash drive.

 ②Enable IIS

For developers, it should be a small case to enable IIS. Not much to say here.

2. Installation

The initial IIS does not support php, so we first downloaded the PHP Manager tool. After successful installation, you can see the php manager icon in IIS, as shown below:

Enter php manager. The subsequent configuration is relatively simple, please search it yourself. The focus of this article is on breakpoint debugging, so I won’t go into details. After the php configuration is completed, you will see the following interface:

Copy the downloaded xdebug decompressed file to the ext folder of the php directory

The next step is to install the IDE. The PHPStorm installation is very simple. I won’t go into details here. Xdebug helper is an extension tool for Chrome. Enter chrome://extensions/ in the browser and then download it. Just drag the crx file into the page.

3. Configuration

 ①Xdebug

There are many Xdebug configurations online. Here I only give my configuration. In the php.ini file, add the following code and pay attention to the locations of several of the files.

 ?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<font face="NSimsun">[Xdebug] ;xdebug配置 </font>
zend_extension="D:/php/php-5.6.8-nts-Win32-VC11-x64/ext/php_xdebug-2.3.2-5.6-vc11-nts-x86_64.dll" <code class="php plain"><font face="NSimsun">;载入Xdebug </font>;Load Xdebug
xdebug.idekey="PHPSTORM"
<font face="NSimsun">xdebug.profiler_enable=on </font>xdebug.profiler_enable=on <div class="line number5 index4 alt2"> <font face="NSimsun"> <code class="php plain">xdebug.trace_output_dir="D:/php/xdebug-log"<font face="NSimsun">;xdebug 的数据文件目录 </font> <div class="line number6 index5 alt1">;xdebug data file directory <font face="NSimsun"><code class="php plain">xdebug.profiler_output_dir= "D:/php/xdebug-log"<font face="NSimsun">;xdebug 的数据文件目录 </font>
<code class="php plain"><font face="NSimsun">xdebug.auto_trace = On ;开启自动跟踪 </font>;xdebug data file directory
<font face="NSimsun">xdebug.show_exception_trace = On ;开启异常跟踪 </font>xdebug.auto_trace = On ; turn on automatic tracing <div class="line number9 index8 alt2"> <code class="php plain"><font face="NSimsun">xdebug.remote_autostart = Off ;开启远程调试自动启动 </font> <div class="line number10 index9 alt1">xdebug.show_exception_trace = On ; Turn on exception tracking <code class="php plain"><font face="NSimsun">xdebug.remote_enable = On ;开启远程调试 </font>
<code class="php plain"><font face="NSimsun">xdebug.remote_handler=dbgp ;用于zend studio远程调试的应用层通信协议 </font>xdebug.remote_autostart = Off; turn on remote debugging to start automatically
<font face="NSimsun">xdebug.remote_host=localhost ;允许连接的zend studio的IP地址 </font>xdebug.remote_enable = On ; turn on remote debugging <div class="line number13 index12 alt2"> <code class="php plain"><font face="NSimsun">xdebug.remote_port=9001 ;反向连接zend studio使用的端口 </font> <div class="line number14 index13 alt1">xdebug.remote_handler=dbgp;Application layer communication protocol for zend studio remote debugging <code class="php plain"><font face="NSimsun">xdebug.collect_vars = On ;收集变量 </font>
<code class="php plain"><font face="NSimsun">xdebug.collect_return = On ;收集返回值 </font>xdebug.remote_host=localhost ;IP address of zend studio that allows connection
<font face="NSimsun">xdebug.collect_params = On ;收集参数 </font>xdebug.remote_port=9001; Reverse connection to the port used by zend studio <div class="line number17 index16 alt2"> <code class="php plain"><font face="NSimsun">xdebugbug.max_nesting_level = 10000 ;如果设得太小,函数中有递归调用自身次数太多时会报超过最大嵌套数错</font> xdebug.collect_vars = On ;Collect variables
xdebug.collect_return = On ; collect return value xdebug.collect_params = On; collect parameters xdebugbug.max_nesting_level = 10000; If set too small, the function will report an error exceeding the maximum nesting number if it calls itself recursively too many times

 ②PHPStorm

Enter php settings

Select php language settings

Add an interpreter. In fact, if you are running in IIS, you do not need to add an interpreter. However, if you open your php code directly through phpstorm, you need to add an interpreter, as follows, press Alt F2. Running php through the interpreter does not require installing IIS

The next step is to configure phpStorm’s debug. In fact, phpstorm's debug basically has default settings, but we'd better modify it because port 9000 may be occupied by other applications. So we need to change to other port such as 9001

Note: The port here must be consistent with the port configuration in xdebug in php.ini. Please see the configuration code above.

xdebug.remote_port=9001; Reverse connection to the port used by zend studio

 ③xdebug helper

It is a plug-in for Chrome. It is really easy to use and the configuration is very simple. Just go to the picture above

This configuration is basically over. Let’s test it below.

IV. Breakpoint debugging and testing

① Find the page, turn on debugging, click on the bug, and select Debug.

 ②PHPstorm turns on monitoring

Refresh the page http://localhost/php/FirstPHP.php

Running results:

The result runs correctly. This article ends here. I hope it can be helpful to the viewers.

The above is the entire content of this article, I hope you all like it.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/991646.htmlTechArticleBuilding a PHP5.6 environment under WIN8.1 Many people like to use linux to build a php web language running environment, but due to linux Highly customized, often requiring root to run commands, slightly high-end, corresponding to micro...
Statement of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1658
14
PHP Tutorial
1257
29
C# Tutorial
1231
24
How does session hijacking work and how can you mitigate it in PHP? How does session hijacking work and how can you mitigate it in PHP? Apr 06, 2025 am 12:02 AM

Session hijacking can be achieved through the following steps: 1. Obtain the session ID, 2. Use the session ID, 3. Keep the session active. The methods to prevent session hijacking in PHP include: 1. Use the session_regenerate_id() function to regenerate the session ID, 2. Store session data through the database, 3. Ensure that all session data is transmitted through HTTPS.

Explain different error types in PHP (Notice, Warning, Fatal Error, Parse Error). Explain different error types in PHP (Notice, Warning, Fatal Error, Parse Error). Apr 08, 2025 am 12:03 AM

There are four main error types in PHP: 1.Notice: the slightest, will not interrupt the program, such as accessing undefined variables; 2. Warning: serious than Notice, will not terminate the program, such as containing no files; 3. FatalError: the most serious, will terminate the program, such as calling no function; 4. ParseError: syntax error, will prevent the program from being executed, such as forgetting to add the end tag.

PHP and Python: Comparing Two Popular Programming Languages PHP and Python: Comparing Two Popular Programming Languages Apr 14, 2025 am 12:13 AM

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

What are HTTP request methods (GET, POST, PUT, DELETE, etc.) and when should each be used? What are HTTP request methods (GET, POST, PUT, DELETE, etc.) and when should each be used? Apr 09, 2025 am 12:09 AM

HTTP request methods include GET, POST, PUT and DELETE, which are used to obtain, submit, update and delete resources respectively. 1. The GET method is used to obtain resources and is suitable for read operations. 2. The POST method is used to submit data and is often used to create new resources. 3. The PUT method is used to update resources and is suitable for complete updates. 4. The DELETE method is used to delete resources and is suitable for deletion operations.

Explain secure password hashing in PHP (e.g., password_hash, password_verify). Why not use MD5 or SHA1? Explain secure password hashing in PHP (e.g., password_hash, password_verify). Why not use MD5 or SHA1? Apr 17, 2025 am 12:06 AM

In PHP, password_hash and password_verify functions should be used to implement secure password hashing, and MD5 or SHA1 should not be used. 1) password_hash generates a hash containing salt values ​​to enhance security. 2) Password_verify verify password and ensure security by comparing hash values. 3) MD5 and SHA1 are vulnerable and lack salt values, and are not suitable for modern password security.

PHP: A Key Language for Web Development PHP: A Key Language for Web Development Apr 13, 2025 am 12:08 AM

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

Explain Arrow Functions (short closures) introduced in PHP 7.4. Explain Arrow Functions (short closures) introduced in PHP 7.4. Apr 06, 2025 am 12:01 AM

The arrow function was introduced in PHP7.4 and is a simplified form of short closures. 1) They are defined using the => operator, omitting function and use keywords. 2) The arrow function automatically captures the current scope variable without the use keyword. 3) They are often used in callback functions and short calculations to improve code simplicity and readability.

PHP in Action: Real-World Examples and Applications PHP in Action: Real-World Examples and Applications Apr 14, 2025 am 12:19 AM

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

See all articles