3

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 4

5

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.

1
  • Thanks, this just confirms that I can safely switch the OS to windows and work just as well as the Linux guys.
    – Kyle
    Oct 19, 2011 at 20:47
7

A 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.

4
  • As a side note, the setup we use at my work is a development server that we SSH into to work, and can install whatever we wish on our workstations.
    – Izkata
    Oct 19, 2011 at 21:55
  • When I build webpages, I build on Windows or Mac (depending which company I'm with), but all the servers are always on Linux. Keeping the same case is a VERY important detail when you're not working on a Windows Server. Since I need to test the pages, I upload to the Linux server, then it doesn't really matter what file I put Oct 19, 2011 at 22:17
  • There's also the line endings issue, although I believe most FTP software does automatic conversions. Oct 19, 2011 at 23:22
  • @DisgruntledGoat: even text editors handle line endings in custom fashion, but not all programmers seem to care about setting it up. I've seen code repositories destroyed by a commit with different line endings.
    – vtest
    Oct 20, 2011 at 1:22
2

Some 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 ;)

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.