For the sake of simplicity this tutorial will assume that you are already familiar with Apache, PHP and Netbeans and have them installed on your server. (Following instructions are presented on Ubuntu 7.10 but should be the same for any Linux Flavor)

Set up Debuging (Optional)

  1. Install PHP dev tools sudo apt-get install php5-dev php-pear
  2. install xdebug sudo pecl install xdebug find / -name 'xdebug.so' 2> /dev/null /usr/lib/php5/20060613/xdebug.so
  3. Edit php.ini sudo gedit /etc/php/apache2/php.ini Add the following line zend_extension="/usr/lib/php5/20060613/xdebug.so"
  4. restart apache sudo /etc/init.d/apache2 restart

Instal PHP plugin

Start Netbeans and go to tools and plugins plugin Check PHP plugin and install.

Create a web server profile in Netbeans

  1. In the NetBeans IDE main screen, switch to the Services tab, which shows a tree of available databases and web server profiles.
  2. add Position the cursor on the Web Servers node and from the context menu choose Add Web Server. The Add New Web Server Record dialog box opens.
  3. newserver1 In the Connection Name text field, enter the name of the web server profile and from the Server

    Type drop-down list, choose one of the connection types: Local Web Server with file access. This option assumes that you have a web server installed on your local computer. Every time you run your PHP project, the IDE copies your source files to a specified directory under the web server document root.

  4. Click Next and choose the Manual Configuration option. In the Apache config file Location text box, specify the location of the httpd.conf file.
  5. From the Choose Host Name drop-down list, select the relevant virtual host. In a development environment, typically, only one choice is available.
  6. For the Solaris operating system, the server can be specified automatically: Use the Find Servers button to get a list of currently available servers. Choose the appropriate item from the list.
  7. To specify the server manually, from the Server Location dropdown list, choose the relevant server
  8. Click Next.
  9. In the Base Directory text field, enter the subfolder of the Document Root where your PHP files will be copied. To deploy your web applications to the web server root, leave this field empty.
  10. Click Finish.

CREDITS I have taken some help for this tutorial from some other sites Thanks to: for xdebug info: martin_lindhe for Web server info: Netbeans tutorials

Advertisements