Jump to content

new to php - can/how do i do this?


squeaky

Recommended Posts

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.

Link to comment
Share on other sites

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?

 

 

 

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

 

 

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.