


Eclipse development PHP debugging (debug) environment configuration_PHP tutorial
I recently developed using PHP and couldn’t debug it, which was very frustrating. I found an article online about setting up an environment. Some of it was out of date, and many of the details were not mentioned. It’s quite difficult for a novice like me, so I’m writing it here. This article is about my own installation process, I hope it can help everyone. Reference article link: http://www.BkJia.com/kf/201111/111881.html
The version I finally chose is as follows
APACHE : httpd-2.2.21-win32-x86-no_ssl.msi
PHP : php-5.2.17-Win32-VC6-x86.msi
Eclipse: : eclipse-php-galileo-SR2-win32.zip
ZendDebugger : ZendDebugger-v5.2-cygwin_nt-i386
The download link is as follows (you can choose other higher versions by yourself):
1. Apache, download here
2. PHP, download here Note that VC6 corresponds to the apache platform, and VC9 corresponds to the IIS platform. Pay attention to the difference between thread safety (ts) and thread unsafe (nts) in the version. When installing zenddebugger, choose the corresponding version. , the configuration files must also correspond
3. Eclipse IDE for php, download here
4. Zend Debugger, download here
1. Install software
1. apache installation
You only need to install it step by step. After the installation is completed, apache will be started. At this time, enter http://localhost/ in the browser and
will appear.It works!
It means that apache is installed successfully.
2. PHP installation
Just install it step by step. It should be noted that when installing the PHP extension, it must be installed by default, otherwise
will appear.
"Error trying access the local web service:GetObject Failed. You will need to manually configure the web server"
It may be because the extension module cannot be found.
After installation, PHP will automatically add the following columns to the apache configuration file
view plain
#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL PHPIniDir "
LoadModule php5_module "php5apache2_2.dll"
#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
At this time, you need to complete it. If you add it, it will prompt that it cannot be found. Use the command httpd -t in cmd and it will prompt that the module php5apache2_2.dll cannot be found. For example, my PHP is installed under C:Program Files/PHP. Note that the path is split using "/", not ""
view plain
#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL PHPIniDir "C:/Program Files/PHP"
LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll"
#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
Create a file index.php in the apache document directory and enter the following content
phpinfo();
?>
Restart apache
Enter http://localhost/index.php in the browser and PHP version information will appear, indicating that PHP and apache have been successfully built
2. DEBUG environment configuration
1. ZendDebugger
Find the corresponding version from the downloaded ZendDebugger and select it according to the PHP version (my PHP is 5.2, thread-safe). At this time, you should pay attention to selecting thread-safe or unsafe. Copy the corresponding ZendDebugger.dll to the apache installation directory, for example, I Select ZendDebugger-v5.2-cygwin_nt-i3865_2_x_compZendDebugger.dll (thread-safe) to C:Program FilesPHP. Add the following lines in php.ini (modify the path according to your own situation)
view plain
zend_extension_ts=C:/Program Files/PHP/ZendDebugger.dll
zend_debugger.allow_hosts=localhost,127.0.0.1
zend_debugger.expose_remotely=always
Copy dummy.php to the corresponding document directory of apache.
2. Configure Apache
For example, if I place all Eclipse projects under E:EclipseWorkspace, then modify Apache/conf/httpd.conf and add:
at the end of the file.
view plain
Alias /workspace/ "E:/EclipseWorkspace/"
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
The advantage of this is that all PHP projects share an apache configuration (see how to set it up below).
3. eclipse configuration
Open Eclipse->Window->Preferences->PHP:
PHP Executables->Add, set as follows:
PHP Servers->New, set as follows: Note that the W in the Workspace inside is changed to a lowercase w. If it is inconvenient to capture the picture, use the one in the original article. If you don’t change it, you will not be able to debug the page
Note that workspace is added in the URL column. This is the directory alias added in httpd.conf.
PHP Debug, as shown in the figure below, select the appropriate Debugger, Server
At this point, the configuration is complete.
Remember to restart Apache again.
Finally, build a test program to see how it works:
Create a new PHP Project and name it FirstPHPTest. Of course, we use our E:EclipseWorkspace as the Eclipse workspace directory.
Create a new PHP File in the project, such as using index.php above.
When you right-click Run As->PHP Web Page on index.php, you can see a screen similar to the following:

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

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

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

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

If you are an experienced PHP developer, you might have the feeling that you’ve been there and done that already.You have developed a significant number of applications, debugged millions of lines of code, and tweaked a bunch of scripts to achieve op

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.
