squeaky Posted March 28, 2008 Share Posted March 28, 2008 Can I develop a php website on a windows development machine and then move it to a Linux production server? What if anything should I be aware of? Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/98408-new-to-php-canhow-do-i-do-this/ Share on other sites More sharing options...
wildteen88 Posted March 28, 2008 Share Posted March 28, 2008 Yes you can, php is can run on Windows and linux just fine. The only thing you should not do whilst developing your scripts on Windows is to use Windows based file paths, eg: include "C:/path/to/file.php"; This will not work on linux. When including files do something like this instead: include $_SERVER['DOCUMENT_ROOT'] . 'path/to/file.php'; That way your script will be more portable. Also try to match the PHP settings on the Windows box to the same/as close to the Linux box setup by comparing the information phpinfo() generates. Quote Link to comment https://forums.phpfreaks.com/topic/98408-new-to-php-canhow-do-i-do-this/#findComment-503610 Share on other sites More sharing options...
BlueSkyIS Posted March 28, 2008 Share Posted March 28, 2008 depending on your version of PHP, a few functions work incorrectly or not at all on Windows. i wouldn't worry about it until if/when you run into the problem. in newer PHP (5+), most if not all of those issues have been rectified. Quote Link to comment https://forums.phpfreaks.com/topic/98408-new-to-php-canhow-do-i-do-this/#findComment-503613 Share on other sites More sharing options...
phpnoobie9 Posted March 28, 2008 Share Posted March 28, 2008 Install this on your computer: www.wampserver.com Quote Link to comment https://forums.phpfreaks.com/topic/98408-new-to-php-canhow-do-i-do-this/#findComment-503614 Share on other sites More sharing options...
squeaky Posted March 28, 2008 Author Share Posted March 28, 2008 Wildteen88 - Thanks for the reply. That has been my biggest concern. I have been developing classic asp websites for almost ten years on a Windows Production Machine. All my includes are done virtually from the root. I want to follow the same pattern on the php. Thank you so much for the help. BlueSkyIS - running PHP Version 5.2.4 - thanks for the heads up. phpnoobie9 - is that required? Quote Link to comment https://forums.phpfreaks.com/topic/98408-new-to-php-canhow-do-i-do-this/#findComment-503636 Share on other sites More sharing options...
wildteen88 Posted March 28, 2008 Share Posted March 28, 2008 phpnoobie9 - is that required? In order to run your php scripts on your Windows box you'll need to install what is called the AMP stack, which consists of Apache (server), MySQL (database) and PHP. However you may find it comfortable to use IIS for the server as your have developed ASP websites. But it would better to use Apache as this is will most like be the server install on the Linux box. There are a few packages ready available which will setup AMP on Windows. The two most popular being WAMP and XAMPP. However I prefer a manual install myself. Also it is better to have a local copy of AMP installed whilst creating your PHP. This bypasses the need to having to upload your files to the website, logging on to the net and then testing the script on the website. If its installed locally you can simple go to http://localhost to test your scripts. Quote Link to comment https://forums.phpfreaks.com/topic/98408-new-to-php-canhow-do-i-do-this/#findComment-503649 Share on other sites More sharing options...
squeaky Posted March 28, 2008 Author Share Posted March 28, 2008 Hi wildteen88 - I'm currently working on an XP box, running iis, I just installed php Version 5.2.4 I'm accessing all my sites via localhost. (I cannot figure out how to get a dns running on XP - I just don't have the brain power right now - so I suffer.) I do all my professional development on this machine - can I run both IIS and Apache on the XP? What concerns if any do I need to be aware of? I want to be able to write php sites for the linux/apache environment as well as windows/iis. Can I develop one php site and have it function properly on both systems? Quote Link to comment https://forums.phpfreaks.com/topic/98408-new-to-php-canhow-do-i-do-this/#findComment-503665 Share on other sites More sharing options...
wildteen88 Posted March 28, 2008 Share Posted March 28, 2008 You can develop your script to work on IIS and Apache. However just make sure you don't use any server specific environment variables, such as with IIS you can retrieve the user login name from Windows. On Apache you can't do this. However I would ditch IIS and just concentrate on Apache. Apache is the most used server for hosting PHP sites over IIS. It is up to you though If you are going to install both IIS and Apache then be careful when installing Apache. Both Apache and IIS use the same port for listening for http requests (port 80). When you install Apache on windows you'll have to modify Apaches httpd.conf to listen on a different port. Quote Link to comment https://forums.phpfreaks.com/topic/98408-new-to-php-canhow-do-i-do-this/#findComment-503674 Share on other sites More sharing options...
squeaky Posted March 29, 2008 Author Share Posted March 29, 2008 Hi wildteen88 Thank you so much for your help. Have a great night! Quote Link to comment https://forums.phpfreaks.com/topic/98408-new-to-php-canhow-do-i-do-this/#findComment-503688 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.