Eclipse Development PHP Debug (Debug) environment Configuration _php Tutorial

Source: Internet
Author: User

Recently with the development of PHP, can not debug very depressed, and then find an article on the Internet to build the environment, some of them are outdated, and many of the details are not mentioned, for the rookie like me is more difficult, especially in this write an article of my own installation process, I hope to help everyone. Reference article link: http://www.BkJia.com/kf/201111/111881.html

The final version I 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 a different version later):
1. Apache, Download here
2. PHP, here to download Note VC6 corresponding to the Apache platform, VC9 corresponding to the IIS build platform, to pay attention to the version of the thread Security (TS) and Threads of unsafe differences (NTS), in the installation of Zenddebugger to select the corresponding version, the configuration file should also correspond
3. Eclipse IDE for PHP, download here
4. Zend Debugger, Download here

First, install the software

1. Apache Installation

Only one step-by-step installation is required, Apache will be launched when the installation is complete, and the input http://localhost/will appear in the browser.

It works!

Description Apache installation succeeded.

2. PHP Installation

It is also a step-by-step installation, it is important to note that the installation of the PHP extension should be installed by default, or it will appear

"Error trying access the local Web Service:getobject Failed. You'll need to manually configure the Web server "

There should be no reason to find the extension module.

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 add him complete, if the supplement will be prompted to find, in cmd with the command httpd-t will be prompted to find the module Php5apache2_2.dll. For example, my PHP is installed under C:\Program files/php. Note that the segmentation of the path is in the "/", 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 in the Apache document directory index.php Enter the following:

Phpinfo ();

?>

Restart Apache

Entering http://localhost/index.php in the browser will show PHP version information that PHP and Apache have been successfully built

Second, Debug environment configuration

1. Zenddebugger

From the downloaded Zenddebugger to find the corresponding version, according to the PHP version of the choice (my PHP is 5.2, thread-safe), this time to pay attention to the choice of thread safety or unsafe, Copy the corresponding ZendDebugger.dll to the Apache installation directory, for example I choose zenddebugger-v5.2-cygwin_nt-i386\5_2_x_comp\zenddebugger.dll (thread safe) to c \ Program files\php below. Add the following line in the php.ini (the path modifies itself according to its own circumstances)

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 the dummy.php to the Apache corresponding document directory.

2. Configure Apache

For example, I put all the eclipse projects under E:\EclipseWorkspace, then modify the apache/conf/httpd.conf and add it 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 below).

3. Eclipse Configuration

Open eclipse->window->preferences->php:

PHP Executables->add, set up as follows:

PHP Servers->new, set as follows: Note that the inside of the workspace W to lowercase w, inconvenient to grab the picture with the original article, if not to debug the page

Note that workspace is added to the URL bar, which is the directory alias added in httpd.conf.

PHP Debug, as shown, 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 named Firstphptest, of course, using our E:\EclipseWorkspace as the workspace directory for Eclipse.

Create a new PHP File in the project, such as using the index.php above.

When you right-click Run as->php Web page on index.php, you can see something like this:

Share to:


Author Sayo.net

http://www.bkjia.com/PHPjc/478523.html www.bkjia.com true http://www.bkjia.com/PHPjc/478523.html techarticle recently with the development of PHP, can not debug very depressed, and then find an article on the Internet to build the environment, some of them are outdated, and many of the details are not mentioned, for like me the dish ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.