simpgm25 Posted December 7, 2006 Share Posted December 7, 2006 I work on a small net work that has a W2K web server running IIS 5.0. We have PHP installed and it works on our web site. I did not write this web site. I am in school learning about web programming. Right now I just want to get a simple php script to run. Period! My question is this. Does a PHP file have to be run from a web site that is PHP functional or can you just create a PHP file on a server that has php and IIS installed and run it in a folder in the C drive for testing? Right now I am just trying the famous echo "Hello world;" example. Simeon Bryant Quote Link to comment Share on other sites More sharing options...
papaface Posted December 7, 2006 Share Posted December 7, 2006 PHP can only be ran from a webserver. If apache and php are installed on the system you will be able to run the script by going to localhost/scriptname.php.Also your echo example should be[code]echo "Hello World";[/code] Quote Link to comment Share on other sites More sharing options...
trq Posted December 7, 2006 Share Posted December 7, 2006 You test locally by placing your files in your webservers root directory and then viewing http://localhost//yourscript.php via a broswer. Of course, you need a webserver setup on the machine. Quote Link to comment Share on other sites More sharing options...
marcus Posted December 7, 2006 Share Posted December 7, 2006 There are multiple webservers for your computer, you can do a quick google search for xampp or wamp5 Quote Link to comment Share on other sites More sharing options...
simpgm25 Posted December 7, 2006 Author Share Posted December 7, 2006 I appreciate you guys help.Our web sever is IIS and we have a web site currently running on it using php. When you set up a website in IIS you have to go under the home folder tab and then configuration and make sure that the php extension is in there. Thats how our current site is and it works. That's why I asked in my first question, does the php file have to be running off of a web site that is set up in IIS? I just want to be able to test php files for practice. I still don't have it working. I know this is very simple but I am just spinning my wheels.Simeon Quote Link to comment Share on other sites More sharing options...
jsladek Posted December 7, 2006 Share Posted December 7, 2006 I'm guessing you know that you need <? ?> around the php code... also check the configuration off the IIS. I think you can specify what file extentions to process php code. Like .htm, .html, .php make sure your extention is one that it will look for the php.-John Quote Link to comment Share on other sites More sharing options...
trq Posted December 7, 2006 Share Posted December 7, 2006 [quote]does the php file have to be running off of a web site that is set up in IIS?[/quote]Yes. Quote Link to comment 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.