PHP development environment in Linux

Source: Internet
Author: User
Tags php development environment netbeans

 

I. Eclipse PHP

 

First, try to install Eclipse and put the workspace directory under the/var/www/html directory to solve various problems. But it still does not solve the problem. Later, Zend provided Eclipse was installed, and the problem persists. Give up!

 

Installing Eclipse PHP

 

Install Zend plugin:

 

Http://code.google.com/p/zend-sdk/wiki/ZendSdkEclipsePlugin

 

 

 

Ii. NetBeans

 

Many netizens praised netbeans on the Internet, so

 

1. Install NetBeans

 

 

 

1) download the sh file,

 

Https://netbeans.org/downloads/

 

2) execute Installation

 

Run: chmod + x netbeans-7.3-linux.sh;./netbeans-7.3-linux.sh;

 

Start installation, and prompt that jdk cannot be found. Later, find several versions in/usr/jvm/lib/jd *****, but netbeans still prompts that the version is too low.

 

So: download the latest jdk version jdk_1.7.0_21. Then install it all the way.

 

3) Run

 

After installation, go to the installation directory (default:/usr/local/netbeans-7.3/bin/), double-click the netbeans icon to start netbeans

 

4) create a PHP Project

 

After the file is created, the default source folder directory is under/var/www, instead of/var/www/html. Change the "/var/www/html" directory in the httpd conf file, "/var/www ". You can run it normally.

 

You can also change the source folder and project folder corresponding to the project without changing the httpd conf file.

 

 

 

The Debuger seems to be a little slow. wait a long time and wait for a while, or waiting. Solve this problem:

 

 

 

2. Install xdebug

 

Https://github.com/xdebug/xdebug

 

 

 

1) Unpack the tarball: tar -xzf xdebug-2.2.x.tgz.  Note that you donot need to unpack the tarball inside the PHP source code tree.Xdebug is compiled separately, all by itself, as stated above.2) cd xdebug-2.2.x3) Run phpize: phpize   (or /path/to/phpize if phpize is not in your path).4) ./configure --enable-xdebug (or: ../configure --enable-xdebug   --with-php-config=/path/to/php-config if php-config is not in your   path)5) Run: make6) cp modules/xdebug.so /to/wherever/you/want/it7) add the following line to php.ini:   zend_extension="/wherever/you/put/it/xdebug.so"

 

   #The following is my config:

 

   zend_extension = /usr/lib64/xdebug.so   xdebug.remote_enable=on   xdebug.remote_log="/var/log/xdebug.log"   xdebug.remote_host=localhost   xdebug.remote_handler=dbgp   xdebug.remote_port=9000

 

 

 

8) Restart your webserver.(since php is part of webserver)9) Write a PHP page that calls "phpinfo();" Load it in a browser and   look for the info on the xdebug module.  If you see it, you have been   successful!

 

 

 

After completing the preceding steps, the xdeug table is displayed on the phpinfo page, indicating that the table is successfully created.

 

Unfortunately, the debug buttons of netbeans are still gray. Cannot debug; view the log:/var/log/httpd/error_log. selinux exists in the log, disabled selinux in/etc/sysconfig/security, and restart the system. Still not solved.

 

 

 

Change the port in the php. ini file to 9001, restart httpd, and change the netbeans port to 9001. OK!

 

Very strange, so I changed the port in php. ini and netbeans -- debug -- options-php-debug to 9000 again. It can also work normally.

 

So far, php running under netbeans and debug are all OK.

 

This 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.