For doing development, does it matter what OS PHP is running on? In other words would it be fine to develop a PHP application on Windows and deploy on Unix (or vice versa)?
In other words, do PHP applications run identically on Windows and Unix?
Almost, but not quite. There are a couple of things you have to watch out for.
1) File names: Windows is a case-insensitive operating system. If you create a file Foo.php, you can include it using include('Foo.php') OR include('foo.php'). When you move your project to Linux/Unix, this will break if you don't have the right case.
2) There are some language-specific platform differences, generally when it comes to something that relies on integrated OS functionality. These rarely come up, but you might run into them occasionally. For example, the checkdnsrr() function didn't exist in Windows PHP until version 5.3.0.
I had one more too, but I think I need a coffee, my brain just stopped.
Edit: Oh yeah, I remember:
3) Installs. The PHP packages you get for Linux/Unix can very widely in what they include in a default install compared to Windows. You need to make sure to test your app on a development box of the opposite platform just to be sure you have all the required libraries compiled/added in, or you'll get some nice fatal errors from an otherwise normal looking app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With