Use separate folder from apache to develop with PHP

| April 29, 2012 | 2 Comments

Php_codeMost of php developers use in their local environments a configuration similar to:

  • Apache + PHP + Mysql. It´s very common the use of integrated solutions such us XAMPP.
  • IDE such us Eclipse (eclipse PDT), Zend Studio,etc..
  • A debugger: Zend Debugger is the most recommended.


Install XAMPP (or similar solutions) and the IDE is easy and there are many tutorials that talk about it:

But there is one thing that is important to do: put your workspace outside the htdocs folder in your apache server.

Use separate folder from apache to develop with PHP

For this task you only have to add an alias to your apache configuration. Go to your http.conf file:


Remember to save a copy of the file before editing it.

To add an alias you can add the next lines inside <IfModule alias_module> tag:

#Alias for project
Alias /phplist "D:\desarrollo\workspace\project"
#Directorio para el alias de phplist
<Directory "D:\desarrollo\workspace\project">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all</Directory>


  • /proyect: reference to the url use by apache to publish the site. You can try it putting http://localhost/proyect in your navigator.
  • D:\desarrollo\workspace\proyect\:  your workspace.
  • <Directory>: give permission to workspace folder from apache web server.



Tags: ,

Category: Others

Comments (2)

Trackback URL | Comments RSS Feed

  1. Aldemir says:

    I own a Zend license. I have had just hriorfic experience with Zend’s support in the past. I have finally just put it aside. I count it up as an expensive but bad decision. I have played with Eclipse also. It just seemed they were making it harder then necessary to get things working like debugger etc.I have a friend who works for Sun and he recommended I give NetBeans a try. Nothing to lose since it is open source. I have to say it made things much easier, at least for me, to get my head around it and be productive. On occasion I still do some work in Dreamweaver also. I don’t use the snipits and coding stuff, I just use it as a way to quickly layout html and CSS work. Great for prototyping also.Just my $.02I love your site and info!

    • Paco says:

      Hi Aldemir

      As you say the problem with using Eclipse (I don´t know about using Netbeans with php projects) is that it is very difficult to prepare a good environment for work: configure workspaces, debugginng, etc… Zend Studio is already prepared to be used but it is a commercial product, I never use the Zend support so I don´t have experience with them.

      Respect to Dreamweaver, I used it at the beggining of my career because it is easy to manage. The problem is that generate a lot of code and not in a proper way, for example putting the css styles in the same html page.

Leave a Reply