[nycphp-talk] Virtualbox as a dev environment
Gary Mort
garyamort at gmail.com
Fri Sep 2 13:12:43 EDT 2011
On 9/2/2011 12:42 PM, Rolan Yang wrote:
> What's your thought on using XAMPP instead of creating a bunch of
> virtual machines? You could run two instances of apache (php ver 5.2 &
> 5.3) on different ports and have both reference the same web directory
> and mysql. I have found XAMPP to be slow (umm, my laptop is a Dell
> D410 Pentium Mobile with 1GB RAM) but it's probably not as taxing on
> the resources as booting up two whole virtual Linux OS's within a
> Windows OS.
I tried setting up XAMP and MAMP with multiple PHP versions and it was a
nightmare because they load some DLL's for PHP that can only be loaded once.
Separate directories didn't work too well either because of registry
settings. And running both simultaneously dragged down the entire system.
Note, I don't have 2 virtual machines. I use one virtual machine
configured to use fastCGI for PHP so I can use 3 different versions of
PHP at the same time[5.2, 5.3, 5.4].
It is the virtual machine definition, which is based on the domain name
of the url, which determines which fastcgi server to use. If I go to
http://mytest.53.osm it will use PHP 5.3, if I go to
http://mytest.52.osm it will use 5.2
The real beauty, for me, is that it uses the same directory for either
PHP version. They both read from the /var/www/mytest directory, it is
just the PHP interpreter that is different. [in fact, one thing I'm
thinking of doing is to setup some additional sub-options, basically run
3 or 4 fastcgi servers for PHP 5.3,
mydomain.53.osm - straight PHP 5.3, display errors disabled
mydomain.53e.osm - same PHP executable, different php.ini to enable
display errors but don't show me notices, strict, or depreicated.
mydomain.53s.osm - same PHP executable, different php.ini to show strict
and deprecated
mydomain.53a.osm - same PHP executable, different ini, show me all the
errors
As for speed, it is DAMN fast. Giving it 2G of memory is probably
overkill. :-) And when the hurricane came through and I lost internet,
everything was sitting on my local system with the same linux config
from the server.
More information about the talk
mailing list