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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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')ORinclude('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.