Saturday, June 9, 2012 #

Linux,Apache,NetBeans,PHP == Windows,IIS/Cassini,Visual Studio,ASP.Net

I've worked out how to get my linux based Netbeans PHP development machine to behave much like what happens when you create a new ASP.Net project in Visual Studio.

Firstly create multiple PHP project in Netbeans,say for example mysite1 and mysite2. Next edit the apache2/sites-enabled/000-default file and add two virtualhost sections as below

<VirtualHost 127.0.1.1>

ServerName mysite1.localhost

DocumentRoot /var/www/mysite1/

</VirtualHost>

<VirtualHost 127.0.2.1>

ServerName mysite2.localhost

DocumentRoot /var/www/mysite2/

</VirtualHost>

For each site you add, pick a different ip address similar to the above where I use the third octet to increment, next edit the etc/hosts file and add the following two lines

127.0.1.1 mysite1.localhost

127.0.2.1 mysite2.localhost

Then in Netbeans, go to File->Project Properties click on 'Run Configuration' and set 'Project Url' to http://mysite1.localhost for the first project and http://mysite2.localhost for the second project.

That will give you a PHP development box which develops multiple PHP projects similar to how a Visual Studio Windows based box handles multiple ASP.Net sites.

Hope this helps someone :)

Posted On Saturday, June 9, 2012 8:49 AM | Comments (0)

Copyright © Neil Smith

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski