Hacker News new | ask | show | jobs
by soulclap 4784 days ago
"There's no chance it can work on Windows, due to the dependency on POSIX features". Too bad.
4 comments

PHP and Windows are often enough at odds that not having a nice REPL is probably going to be the least of your problems. The other poster is right, bring up a VM and be happy.
Huh? PHP and IIS work perfectly fine together. MS has worked really hard to make PHP a first-class language on their OS. PHP 5.3 and IIS 7.5+ are dead simple to get working. Azure features PHP support as one of their main features.

I've even got a client on an ancient Windows 2000 box running PHP. Took all of an hour to get running. Yes, not the most preferred stack, but they aren't at odds.

If you are using IIS/PHP how interchangeable is that with LAMP? In other words if I develop locally using IIS/Windows can I just drop the same code onto a LAMP server without breaking anything?
There are a few functions that are not available on Windows.

If you hard-code paths in the code that refer to Linux-specific things, it won't work in Windows.

That said, if it works on Windows, it will most likely work on Linux, but a VM should still be favored due to the probability of prod being Linux.

I run PHP on Windows but with the full LAMP static (Apache running on Windows) and deploy to Linux without modification. I suspect you could also do that with IIS (as PHP abstracts the server interface) but I have not tried it.
I just wanted to point out that it unfortunately doesn't work on Windows. And thanks for the suggestions, I am regularly setting up and using VMs already.
just get a VM running linux. If you are to lazy to set up PHP get a pre build stack at http://bitnami.com/stack/lamp
Sometimes I wish Apple had gone with BeOS instead, so that both major desktop OSs wouldn't be native POSIX and thus make developers more aware of portability issues.
It would be better if MS has gone with Posix Standard instead of causing everyone trouble and making proprietary non-standard OS. Portability takes a lot of work, which could've been used to improve the program, instead of trying to get stuff to work with the crappy Windows API. We need less fragmentation, not more. I would hate to write separate programs for Windows, BeOS/Haiku/Mac and *nix.

In my opinion, Unix is much nicer than BeOS. Also, BeOS uses C++, and not all programming languages work nicely with OO. In contrast it is easy to use all languages with C.

Also, why don't you complain when someone makes a program that only works for Windows? There percentage of Unix-only programs is really small compared to number of Windows-only programs.

> It would be better if MS has gone with Posix Standard instead of causing everyone trouble and making proprietary non-standard OS.

POSIX only offers support for command line stuff and daemons. There isn't any GUI POSIX standard, so you only get half-way portability anyway.

Plus anyone with commercial UNIX experience knows that POSIX is like HTML, just because the standard is supported, it does not mean it works the same everywhere.

> Portability takes a lot of work, which could've been used to improve the program, instead of trying to get stuff to work with the crappy Windows API. We need less fragmentation, not more. I would hate to write separate programs for Windows, BeOS/Haiku/Mac and *nix.

Welcome to the 80-90's.

> In my opinion, Unix is much nicer than BeOS. Also, BeOS uses C++, and not all programming languages work nicely with OO.

This is becoming a niche with major OS and compiler vendors slowly focusing on C++.

> In contrast it is easy to use all languages with C.

If the OS has a C ABI, yes.

> Also, why don't you complain when someone makes a program that only works for Windows? There percentage of Unix-only programs is really small compared to number of Windows-only programs.

Because I use computers since 1986 and UNIX used to be just one among many OSs. I only cared about it somewhere around 1994, after an history of several home systems.

I wonder if it would work on cygwin.
No, cygwin won't provide POSIX process features, you need to use something that is not Windows. As others say, use a VM. Unfortunately the hard truth with PHP (and many other languages) is that if you're trying to use Windows as a development environment, you're already starting off at a significant disadvantage. If Windows provided equivalent features in its process model, I'd use them, but AFAIK, it doesn't/can't.
I use Ubuntu on my personal computer and for my side projects, but I'm stuck using Windows at work. In any case, I don't develop in PHP so the question was academic.