Configure PHP for eclipse Development

Source: Internet
Author: User

PHP is very interesting and boring, so it's time to choose PHP. It took some time to install PHP. This is not the current PHP development tool.

Eclipse is a good ide Editor, not because it is good, but because it was used before, so it was chosen.
Configuration:
Eclipse3.2 and phpeclipse 1.1.8 (net.sourceforge.phpeclipse_1.1.8.bin.dist.zip)
Servers and PHP
In Apache 2.2
PHP 5
MySQL servers 5.2

Procedure
Decompress phpeclipse(net.sourceforge.phpeclipse_1.1.8.bin.dist.zip) and put it in the eclipse directory. The General Plug-in installation method is the same.

Restart eclipse or add the-clean parameter. Set phpeclipse. There is a phpeclipse web development item in the preferences of Eclipse,

The content to be set includes the following two parts:

PHP external tools
Set the PHP-related and APACHE-mysql-related Paths Based on the path information. Here, we mainly set PHP.
Run php Command: D: \ Server \ PHP \ php.exe
Parser command: D: \ Server \ PHP-l-f {0}

Project defaults is very important here. In many cases, the Development Environment fails because it is not configured properly.

The configuration here is related to the Apache configuration of the local machine. The specific steps are as follows:

Add Apache Virtual Host Name
The purpose is to facilitate development. Of course, this is also because there are several sets of web services running on the local machine, so we need to differentiate them. If it is only development, it is much simpler.

Modify the hosts file and specify the corresponding domain name and IP address. The local host is c: \ winnt \ system32 \ drivers \ etc \ hosts:
127.0.0.1 localhost
127.0.0.1 PHP. Dev
The PHP. Dev name is added, so that when you use this name in the browser, it will directly correspond to the previous IP address.

Add an Apache Virtual Host to the end of the configuration file httpd. conf:
Namevirtualhost FIG: 8080
<Virtualhost127.0.0.1: 8080>
Servername PHP. Dev
DocumentRoot "E:/phpworkspace /"
Errorlog logs/PHP. dev_errorlog.log
Customlog logs/PHP. dev_accesslog.log common
<Directory "E:/phpworkspace">
Options indexes followsymlinks Multiviews
AllowOverride none
Order allow, deny
Allow from all
</Directory>
ScriptAlias/PHP/"D:/Server/PHP /"
Addtype application/X-httpd-PHP. php
Action application/X-httpd-PHP "/PHP/php-cgi.exe"
</Virtualhost>
Set phpeclipse-> Project defaults
Localhost: http://php.dev: 82
DocumentRoot: e:/Eclipse/workspace/
Note: The reason why DocumentRoot chooses this directory is that this is the Development Directory of eclipse, and the directory of the PHP project can be used for testing.

Note: The following virtual hosts are known on the Internet. If Apache cannot be started as described above, you can configure the following:
<Virtualhost127.0.0.1: 8080>
Servername PHP. Dev
DocumentRoot "E:/phpworkspace /"
Errorlog logs/PHP. dev_errorlog.log
Customlog logs/PHP. dev_accesslog.log common
<Directory "E:/phpworkspace">
Options indexes followsymlinks Multiviews
AllowOverride none
Order allow, deny
Allow from all
</Directory>
</Virtualhost>

Related Article

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.