Setting up your workstation for web development
From Joomla! Documentation
Revision as of 19:18, 2 May 2012 by Enav
This article or section is in the process of an expansion or major restructuring. You are welcome to assist in its construction by editing it as well. If this article or section
This article provides detailed instructions for setting up your workstation as a PHP development environment, not only for Joomla! it also should work fine for PHP development in general.
Note There are many possible configurations for doing PHP development environments. Any environment that supports the basic AMP stack (Apache, MySql, PHP) and Subversion should work fine.
Choosing a IDE or text editor
The PHP code is plain text that can be edited with simple text editors like:
- Geany (opensource cross platform text editor)
- Gedit (opensource code editor for linux)
- Notepad++ (opensource code editor for Windows)
- Apple textEditor (Apple's text editor)
But when you are about to work in more advanced projects and need some coding assistance there is a handful of development tools called IDEs (Integrated Development Environment) these are some of them:
- Elcipse IDE (opensource cross platform IDE)
- Netbeans IDE (opensource cross platform IDE)
- UltraEdit IDE (closed source cross platform IDE)
- Aptana IDE (opensource cross platform IDE)
All these advanced tool facilitate the development of PHP code, debugging, and the integration of other tools like SVN or GIT for code version control under the same IDE, but for this article we are going to use explain how to configure Eclipse IDE for our PHP development environment.
This instruction uses Eclipse IDE from chapter 4 and onwards. Please refer to the following links for other development tools:
- NetBeans overview which also references to a video tutorial of NetBeans
The example used and screenshots are for Windows XP, but the basic steps are the same for Linux.
XAMPP is an easy-to-install package that bundles the Apache web server, PHP, XDEBUG, and the MySql database. This allows you to create the environment you need to run Joomla! on your local machine. The latest version of XAMPP is available at the XAMPP web site. Downloads are available for Linux, Windows, Mac OS X and Solaris. Download the package for your platform.
Important Note Regarding XAMPP and Skype: Apache and Skype both use port 80 as an alternative for incoming connections. If you use Skype, go into the Tools-Options-Advanced-Connection panel and deselect the "Use 80 and 443 as alternatives for incoming connections" option. If Apache starts as a service, it will take 80 before Skype starts and you will not see a problem. But, to be safe, disable the option in Skype.
As of August 5, 2010, XDebug has been updated (to version 2.1) which fixes some important bugs (for example, watching local variables for nesting functions). The latest XAMPP package (1.7.3) now includes this new version of XDebug. If you just want to update XDebug, you can download the latest module from . There is a handy website that tells you which XDebug binary you need, depending on your phpinfo() information here. To use it, you just copy the output of your phpinfo() display and paste it into the form on the site.
Installation on Windows
Installation for Windows is very simple. You can use the XAMPP installer executable (for example, "xampp-win32-1.7.3-installer.exe"). Detailed installation instructions for Windows are available here.
For Windows, it is recommended to install XAMPP in "c:\xampp" (not in "c:\program files"). If you do this, your Joomla! (and any other local web site folders) will go into the folder "c:\xampp\htdocs". (By convention, all web content goes under the "htdocs" folder.)
If you have multiple http servers (like IIS) you can change the xampp listening port. In <xamppDir>\apache\conf\httpd.conf, modify the line Listen 80 to Listen [portnumber] (ex: "Listen 8080").
Installation on Linux
Open Terminal and enter:
sudo tar xvfz xampp-linux-1.7.7.tar.gz -C /opt
(replace xampp-linux-1.7.7.tar.gz with the version of xammp you downloaded). It has been reported that the MYSQL database of xampp 1.7.4 does not work with Joomla 1.5.22
This installs ... Apache2, mysql and php5 as well as an ftp server.
sudo /opt/lampp/lampp start
sudo /opt/lampp/lampp stop
starts/stops all the services