


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











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,

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.

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.

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.

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

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

In PHP8, match expressions are a new control structure that returns different results based on the value of the expression. 1) It is similar to a switch statement, but returns a value instead of an execution statement block. 2) The match expression is strictly compared (===), which improves security. 3) It avoids possible break omissions in switch statements and enhances the simplicity and readability of the code.
