Is it dumb to develop for LAMP on WAMP?

后端 未结 10 683
旧时难觅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!

    0 讨论(0)
  • Permissions and the fact that on Windows filenames aren't case-sensitive are the two things I can think of that have been a pain to me. But they are

    1. Solvable, at worst with an ftp client to change permissions.
    2. Good, easy ways to make you a better programmer (in a small way, yes).
    0 讨论(0)
  • 2021-02-04 07:16

    Paths, beware of paths. You can build a whole cms and it would mess up because of paths.

    0 讨论(0)
  • 2021-02-04 07:23

    I've been doing it for the last couple of years and haven't run into any problems yet - if anything it gives you an advantage by forcing you to write more portable code.

    0 讨论(0)
提交回复
热议问题