d4rk_1nf1n1ty Posted June 4, 2012 Share Posted June 4, 2012 Hello all! This is my first post. It has been a while since I've worked with PHP, so bear with me. I installed WAMP on my computer recently. Today, I typed this code in a file (named info.php) to see whether PHP was working properly on my computer: <?php phpinfo(); ?> However, my browser (Chrome) displays this as plain text. I've tried it in other browsers, too, but got the same result. I have also tried restarting my WAMPserver, but still got nothing. Any idea what's going on? I've looked through several forums already, and there were all sorts of ideas, such as altering php.ini files, or adding paths in different places...again, I'm relatively new to this, so if one of these is the solution, it will have to be explained to me thoroughly. Thanks in advance for your help and patience! Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted June 4, 2012 Share Posted June 4, 2012 What URL did you use in your browser? It should have been something like - http://localhost/info.php Quote Link to comment Share on other sites More sharing options...
d4rk_1nf1n1ty Posted June 4, 2012 Author Share Posted June 4, 2012 Hi PFMaBiSmAd, Well, this is embarrassing...that particular URL worked. Why does localhost/info.php work, and not file:///C:/wamp/www/info.php, the latter of which I have been using for all of my pure-html files? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted June 4, 2012 Share Posted June 4, 2012 Php is a (web) server side scripting language. In order for the web server to invoke php, you must make a http request to the web server. file:///C:/wamp/www/info.php is a file system path and simply tells the browser to open the file. No web server is involved. Quote Link to comment Share on other sites More sharing options...
d4rk_1nf1n1ty Posted June 4, 2012 Author Share Posted June 4, 2012 Ok! I get it now. Other .php files I had written are now working, as well, now that I've used the localhost URL. Thanks for the help!! Cheers 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.