PHP Development Environment _php tutorial under Linux

Source: Internet
Author: User
Tags php development environment php source code phpinfo unpack netbeans
First, Eclipse PHP

Try to install Eclipse first, encounter various problems, put the workspace directory into the/var/www/html directory, solve some problems. But it didn't work out at the end. Later, the eclipse provided by Zend was installed, and the problem remained. Give!

Installing Eclipse PHP

Install Zend Plugin:

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

Second, NetBeans

See a lot of online netizens praised NetBeans, so installed a

1. Installing NetBeans

1) Download sh file,

https://netbeans.org/downloads/

2) Perform the installation

After downloading the execution: chmod +x netbeans-7.3-linux.sh;./netbeans-7.3-linux.sh;

Starting the installation, the JDK was not found, and later in/usr/jvm/lib/jd****, several versions were found, but NetBeans is still suggesting that the version is too low.

So: Download the latest version of the JDK jdk_1.7.0_21. Then install it all the way down.

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 creation, the source folder default directory is under/var/www, not/var/www/html, change httpd conf file has "/var/www/html" in two places, for "/var/www". To run correctly.

Or you can change the source folder and project folder for the httpd conf file without changing it.

Debuger seems to be a bit slow, wait and see how, and then a long time, or waiting, hehe, seems to have problems. This solves:

2. Installing 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/php ize 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 above steps, we find that the Phpinfo page has more Xdeug tables indicating success

Unfortunately, the debug buttons in NetBeans are still gray. Unable to debug; View log:/var/log/httpd/error_log, found that there is selinux, to/etc/sysconfig/security disabled off SELinux, and then restart the system. It's still not settled.

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

It was strange that the ports in PHP.ini and Netbeans--debug--options-php-debug were changed back to 9000. can also work properly.

At this point, the PHP run under NetBeans, Debug is OK.

This article goes from the PHP development environment under Linux

http://www.bkjia.com/PHPjc/440314.html www.bkjia.com true http://www.bkjia.com/PHPjc/440314.html techarticle first, Eclipse PHP tried to install Eclipse, encountered a variety of problems, put the workspace directory into the/var/www/html directory, solve some problems. But it didn't work out at the end. Later installed ...

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