Linux under the PHP development environment

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

A,Eclipse PHP


Try to install the Eclipse, the various problems encountered, the workspace directory in your /var/www/html directory, and solves some problems. But in the end is not resolved. Then install the Zend provided by Eclipse, the problem still. Give up!


Installing Eclipse PHP


Install Zend plugin:


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




Two,NetBeans


See online there are many netizens praised NetBeans, so the installation of a


Installing NetBeans 1




1)Download the SH file,


https://netbeans.org/downloads/


2) To perform the installation


The execution after downloading: chmod +x netbeans-7.3-linux.sh; ./ netbeans-7.3-linux.sh;


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


So: download the JDK the latest version of jdk_1.7.0_21. And then all the way to install.


3)Function


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


4)Create a PHP project


After the creation of source folder, the default directory is /var/www, not /var/www/html, &ldquo change the httpd file conf; /var/www/html” two, “ “ /var/www”. Normal operation can be.


Or does not change the httpd conf file, change the project corresponding to source folder and project folder can also be.




Debuger seems a bit slower, wait and see how, wait for a long time, or waiting, ha ha, seems to have a problem. How to solve:




Installing Xdebug 2


https://github.com/xdebug/xdebug




1) Unpack the tarball: tar -xzf xdebug-2.2.x.tgz.  Note that you do
not 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.x

3) 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: make

6) cp modules/xdebug.so /to/wherever/you/want/it

7) 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!




According to the above step is completed, found the phpinfo page many forms xdeug, show that success


But it is a pity NetBeans debug buttons are still gray. Cannot debug; see log: /var/log/httpd/error_log, discovered that it was a SELinux, to /etc/sysconfig/security disabled SELinux, and then restart the system. Still no solution.




The php.ini file in the port to 9001, restart the httpd; and the NetBeans port is also changed to 9001. ok!


Very strange, then the php.ini and netbeans--debug--options-php-debug ports changed back to 9000 can also work.


So far, the PHP operation under NetBeans, debug, OK.


This article from   Linux under PHP development environment


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Randall at October 24, 2013 - 12:45 AM