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 Link to comment https://forums.phpfreaks.com/topic/29810-running-a-simple-php-script/ 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] Link to comment https://forums.phpfreaks.com/topic/29810-running-a-simple-php-script/#findComment-136889 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. Link to comment https://forums.phpfreaks.com/topic/29810-running-a-simple-php-script/#findComment-136893 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 Link to comment https://forums.phpfreaks.com/topic/29810-running-a-simple-php-script/#findComment-136897 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 Link to comment https://forums.phpfreaks.com/topic/29810-running-a-simple-php-script/#findComment-136941 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 Link to comment https://forums.phpfreaks.com/topic/29810-running-a-simple-php-script/#findComment-136950 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. Link to comment https://forums.phpfreaks.com/topic/29810-running-a-simple-php-script/#findComment-136955 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.