Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rawfan's avatar

@toniperic @sitesense : I just found a problem with using homestead in Windows. As the files actually live on your ntfs partition, there are path length restrictions and. Also, the case of filenames is ignored in Windows. That might lead to problems when developing on Windows but deploying on Linux.

@bashy So do you compile your own PHP for stable Debian? 5.4 is almost out-of-life. Also; Ubuntu doesn't just import from Debian. They have an extensive CI system set up to test the packages and dependencies. They usually find many problems (before release) that get fixed. Of course they get fixed directly in Debian and the package gets pulled in again. Ubuntu 14.04 is the most used cloud OS (according to the statistics of Amazon and other clould providers). Many companies (like Google) use it as their company-wide default OS. Where do you get your information that it has stability problems?

1 like
sitesense's avatar

@rawfan you're right, there are some caveats when developing on Windows.

I've only hit the problem of path length limitation (256 (ish) characters) once in 20 years myself. That was when I realised the company's Dropbox wasn't syncing to my local drive fully. It was due to some very deeply nested folder structures on Dropbox, combined with some very long filenames.

To help avoid that, I develop in D:\Code rather than the user's directory and I've yet to come across that problem in actual development.

Regarding case sensitivity, that's a problem that crops up from time to time, especially for the novice. But it tends to sink in after you've been bitten a few times. :)

bashy's avatar

@rawfan Used to but now I use dotdeb. PHP 5.6 with FPM and Nginx. Yes, I know they do, I was just stating that the base of it is an testing/unstable release from Debian. I didn't say Ubuntu 14 was unstable but still wouldn't use it.

1 like
jekinney's avatar

Ubuntu is very new to Linux friendly, arguably the best for that. A very windows XP feel compared to other distros (imo of course). Just as powerful etc, but sometimes that can get in the way as users rely on the GUI to much. Matter of fact, to add to @bashy post there really is only a few main distros such as centos, red hat, Ubuntu fedora, etc and the others are based off them like Mint is Ubuntu with added features and a few managers swapped out.

rrosiek's avatar

I've never had too much of an issue developing on Windows, and as a sysadmin I'm accustomed to using various operating systems. I previously used Windows on the desktop, Linux on the laptop, before tossing all of that out for a "tablet" as a workstation. Never thought I'd say that.

Anyway, I figured I'd throw a basic set of instructions out there for anyone having trouble with the typical Laravel setup on Windows. The Laragon thing looks pretty cool, but I've always felt that if Laravel is your framework of choice, Homestead is the way to go. Taylor goes through great lengths to make the ecosystem easy to work with. Admittedly there was a Homestead bug not too long ago that broke on Windows, but had an easy workaround. All of that is of course resolved.

I'm also well aware that the steps below are far more lengthy than the "apt-get" or "brew" methods, thus "why the heck are you developing on Windows?" Honestly, it takes about 20 minutes to setup vs the 5 on other operating systems. And if you're going through this setup more than twice a year (if that), something is definitely wrong. Really nothing to fuss about.

OK, enough jabber. I'm on Windows 8.1, but nothing will be different on Windows 7. If you're on Vista or XP, well, no wonder why the setup is giving you so much grief.

Grab PHP

  • Go to http://windows.php.net/download/ and grab the latest version of PHP, threaded or non-threaded is fine.
  • Extract contents to C:\php
  • Add path as system environment variable by going to Control Panel > System > Advanced System Settings > Environment variables. Highlight Path and click Edit. Go to the end of Variable value and add: C:\php. Click OK to close all windows.
  • You may need to edit the php.ini and uncomment some modules needed, depending what you plan on doing locally, but hopefully not much.
  • Ever need to upgrade/downgrade to another version? Just overwrite the files in this directory with that build. Cake.

Git and a REAL Terminal

  • Grab Git, and run the install with defaults. This will also give us the wonderful GitBash. No, it's not quite a full Bash or Linux shell, but it gives us exactly what we need and is way less messy than Cygwin.
  • The default Windows terminal is absolutely awful. Do yourself a favor and install ConEmu (https://code.google.com/p/conemu-maximus5/wiki/Downloads?tm=2) and put that default "terminal" away for good. You can set default shells to open when the terminal is run. Naturally you want to select GitBash here, which ConEmu will automatically pick up on install.

Composer

Forget the Windows installer here and just download the latest phar and save it to C:\php\composer (no phar extension). We already added that path, so you can pop open ConEmu (in GitBash of course) and run composer. You should see the familiar list of composer commands.

Remember to always run composer commands from your native machine, not a VM!

VM Stuff and Node

Very basic and default installs here, just download and run.

Be sure your machine/processor has virtualization turned on in your BIOS.

Add the global node goodies since we want to run these on our machine, again, not within the slow virtual machine.

npm install bower -g
npm install ember-cli -g  # if that's your thing :)

Global PHARs and Bash Aliases

You can install Homestead and the Laravel installer easily, as documented, with:

composer global require "laravel/installer=~1.1"
composer global require "laravel/homestead=~2.0"

Once again in GitBash, it's useful to setup command aliases. For example, I don't like installing Gulp globally, so I throw it in here. I also do not like the Composer Windows installer, or putting too much in the PATH env, so I use aliases for the global composer installs that are on my native machine.

Run vim .bashrc to open the editor. If you're not familiar with Vim (give it a try), then just use notepad .bashrc. Enter and save the following, or add/remove what works for you.

alias vm="ssh vagrant@localhost -p 2222"
alias homestead="~/AppData/Roaming/Composer/vendor/bin/homestead"
alias laravel="~/AppData/Roaming/Composer/vendor/bin/laravel"
alias gulp="node_modules/gulp/bin/gulp.js"
alias pspec="vendor/bin/phpspec"

Now you can run npm install and gulp from the shell on your machine, nice and fast, without issue. The only thing I tend to run in the VM are artisan commands.

PhpStorm

If an IDE is your thing, you can setup your project to read your local installs easily.

  • In File > Settings > Language and Frameworks > PHP select 5.6 (or whatever) as the PHP language level and then click the ... next to Interpreter to add a new one. For the PHP executable, select C:\php\php.exe. You'll only have to do that once.
  • In File > Settings > Language and Frameworks > PHP > Composer set Path to composer.phar to C:\php\composer and Path to composer.json to the project composer file in the root.

Other stuff

If you work with Ember CLI you should always run the ember serve command "as admin" (can be selected as a tab in ConEmu). For whatever reason running it this way speeds things up.

Be sure to exclude your workspace and other directories with a lot of files or writes (particularly where gulp is watching things) from both Windows Defender and the operating system indexer (Control Panel items).

As far as the "file name is too long" and 255 character thing, I rarely run into this, but when I do, it's trying to rm -rf node_modules; those directories run deep. Simply run the following to easily trash the folder. Someday they'll fix that in NTFS...

mkdir C:\empty
robocopy C:\empty C:\workspace\proj\node_modules /mir
rmdir C:\empty C:\workspace\proj\node_modules

Hope this helps!

3 likes
rrosiek's avatar

I'm not sure how to go about that, might be something @JeffreyWay needs to do.

Glad it worked out for you though!

khoanguyenme's avatar

Does laragon create a vm? or is it just a package installer for the different components? My problem with trying to develop on windows without homestead is that you can't use php artisan tinker.

I'm using wamp on win 8.1 and php artisan tinker work normally

anon11907's avatar

Does anyone else have the problem that Laragon is extremely slow?

bobbybouwmann's avatar

@wilsonc91 Yea had the same issue. Turns out that Homestead on my Mac is still better :D

I do like the installer although the setup guide from @rrosiek was easy as well and both work fine.

rrosiek's avatar

Agreed. If it's slower than VirtualBox, well, there's your answer right there. I don't want to knock Laragon too much because I honestly have not tried it. It seems very cool, but a little bit too much magic there for me; I prefer to know how things are setup and why they work. Much faster and easier to troubleshoot things that way, should problems arise.

I know it prides itself on being quick and easy to setup, but take 10 more minutes with Homestead and you're done. Unless you setup dev machines on a daily basis, the difference is negligible.

Also no PostgreSQL which is a deal breaker for me.

bobbybouwmann's avatar

Homestead gives you almost 100% configuration and options where Laragon can't. So each person who is reading this, dump your windows and take a unix machine (Linux, Mac) and get started with Homestead (or get all the different parts yourself since you work on the same system anyway) and have some fun with Laravel :D

anagnam's avatar

I tried Laragon just now and WOW! its really a blessing for me as Im a windows user. And part of why I stopped buying Jeff "free lunch" months ago is that I just can't follow his styles anymore. I love him when he was starting out in net tuts where hes developing in Windows and I learned a lot from him back then. But now, things changed. he's all mac and I don't have mac and I dont know mac so Im totally lost. But I love to learn PHP and Laravel so many thanks to Laragon! I might start buying again Jeff "free lunch" very soon :)

anagnam's avatar

thanks @rrosiek for the detailed tips. But since Im a complete noob. Im really lost with all those steps. Laragon only took roughly 18secs to install on my Windows 7 machine and Im already rockin' and rollin!

dotcorner's avatar

I tried homestead on windows and although it worked well apart from node modules with long file names. Switched to Laragon, and it worked better on Windows.

Blackadder's avatar

I seriously tried to install homestead, vagrant, and all the other stuff necessary for laravel but every time something went wrong and every tutorial was different.

Laragon just works. That's all I needed.

Although I will definitely use the tutorial @rrosiek posted after I learned the basics of php,sql,html,css and laravel.

simber's avatar

I use Laragon when all I need is apache, mysql, php memcached and/or redis. When I need other services or my application writes to disk then I'll use Homestead.

polarcubs's avatar

Had to use Laragon recently as my macbook got damaged and it's such a breeze!

The creator of Laragon deserves an olympic medal.

1 like
davorminchorov's avatar

Docker wins the gold medal for development environments! Now available for Windows and Mac too! Bye virtual machines.

SaeedPrez's avatar

Just tried Laragon for the first time after another problem with Homestead.. 5 minutes to download, install, config and it has auto-host, turns my ProjectFolder to http://projectfolder.dev ☺ ♥

jlrdw's avatar

@SaeedPrez does laragon basically give you a complete install like a wampserver plus laravel ready to go? And I already have a bitnami wampstack, would one URL address interfere with the other? Like the 127.0.0.0

SaeedPrez's avatar

@jlrdw

This is what it came with:

You can right-click the icon in the task bar, it gives you tons of options and tools..

(.LaragonRoot is my document root folder)

I wanted latest PHP version, all I had to do was unzip it into the PHP folder and I could choose it from this menu. I also added it to my path of course

Also PHP extensions are in the menu for easy (de)activation..

It has a mail catcher too (haven't tried it yet though)

You can configure all ports, there was Apache version as well..

jlrdw's avatar

Thanks @SaeedPrez I might try, currently I am on laravel 5.1 still. If I decide to go for 5.4 could be a good possibility.

Previous

Please or to participate in this conversation.