What are the benefits of using Linux OS to develop a PHP based website?
in a PHP dev environment I recently visited, the lead dev was adamant that they use Linux on their machines for Zend development.
I personally use Windows and have the same results during development. I also design a lot of graphics and am most comfortable using Windows.
Are there any advantages to using Linux over Windows in a development environment, if so, what could they be?
4 Answers
I've been using Windows, Mac and Ubuntu for PHP development, and if your environment is set correctly, there's absolutely no difference imho.
Some tools, like Git, are less available for Windows, so you may need to look for special deployables or use cygwin, but generally speaking, no difference.
1A notable difference is the case-sensitive file system. For example, if you have a file named "Bootstrap.php" (upper case B) and your code contains the line require_once('bootstrap.php'); (lower case b), will work on Windows, and fail on Linux.
Sometimes there are also Windows only, Linux only or even version specific bugs with different libraries used by PHP.
In short, it frequently is best to develop on an environment that is as close as reasonably possible as the production system.
If needed, a possible setup is to use a collection of virtual machines for each environment that you end up programming for.
4Some command line php scripts run into various problems on my Windows machine.
For instance, I have had the Symfony CLI will throw cache:clear errors inside of Windows, whereas it works perfectly in my Linux environment.
I also once ran into the joy of running through ~60 queries because I used camel case in my table names and referred to them as such in my queries (which works under Windows as it ignores case). When I placed the project on our LAMP stack, the queries failed because MySql on Linux stores table names as all lowercase, and they are case sensitive.
Further, since my Windows machine was my local test server, I once ran into a PHP library I needed not being available for Windows.
Little minutia like that has cost me productivity in the past. Then again, so has almost every Ubuntu update, so it's a give-and-take ;)
The simplest one i can think of is that if your development environment, and the deployment environment are similar, you have an easier time pulling in dependencies. If its a self contained project its fine, but in many web based application its necessary to pull in external dependencies - ask your lead dev about what external libraries they use, and how they are updated
Many developers also have a preference for tools that might be in one OS or another - possibly your other developers are fans of Vim or Emacs, for example, or use a cli source control system client by preference.
Of course, you could get the best of both worlds with a VM (or a seperate linux server), and/or the use of putty and smb to do file shares.
At the end of the day though, you need to be comfortable with your basic set up. Start working in windows - find the actual issues you face in the environment, and figure out how to get around them.