Is it dumb to develop for LAMP on WAMP?

后端 未结 10 693
旧时难觅i
旧时难觅i 2021-02-04 06:56

After becoming somewhat estranged open source, and spending some years developing web applications in ASP.Net, I\'m going to start doing quite a lot of PHP / MySQL development.

10条回答
  •  情话喂你
    2021-02-04 07:12

    If you can I'd invest in some kind of linux, or at least *nix, development environment. For simple applications and website your setup is fine, but you will eventually run into subtle differences when you deploy.

    Here are some things off the top of my head you'll want to watch out for if you stick with your Windows environment.

    1. File paths. A lot of PHP functions take file paths as arguments. Do NOT use the windows backslash () separator. Even though you're on windows PHP will let you use a forward slash separator. Ideally abstract this away with your own file path class.

    2. Apache Modules, PECL Extensions. Apache Windows and Apache Unix often come with a different set of Apace Modules installed by default. Also, the same version of a module may run differently on a different platform. If your application relies on any apache module, make sure it's available for both platforms. Same goes for PHP custom extensions (PECL)

    3. Process Forking. Using exec, `, etc. in a web app is a bad idea to begin with, but if you're using these functions they're going to behave differently between windows and *nix

    4. File Writing, Locking, etc. works different

    5. Email is handled differently on both platforms

    6. The PHP group's code word for Windows is "some platforms". You can research more on your own if you'd like

    In general, the closer your development environment matches your production environment, the less environment/deployment related issues you'll have.

    Hope that helps!

提交回复
热议问题