pricelessproperty Posted December 15, 2008 Share Posted December 15, 2008 When I preview the code in firefox via nusphere - my text editor- <?php phpinfo(); ?> loads fine - but when I access it on localhost - which defaults to my desktop files and I select the php file- it just displays <?php phpinfo(); ?>. WTF? Using the latest version of WAMP... short tags turned on in php.ini. Quote Link to comment https://forums.phpfreaks.com/topic/137049-localhost-shows-raw-php-code-wtf/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 15, 2008 Share Posted December 15, 2008 What URL are you entering in your browser? Quote Link to comment https://forums.phpfreaks.com/topic/137049-localhost-shows-raw-php-code-wtf/#findComment-715781 Share on other sites More sharing options...
pricelessproperty Posted December 15, 2008 Author Share Posted December 15, 2008 http://localhost Quote Link to comment https://forums.phpfreaks.com/topic/137049-localhost-shows-raw-php-code-wtf/#findComment-715813 Share on other sites More sharing options...
pricelessproperty Posted December 15, 2008 Author Share Posted December 15, 2008 Yes the url is http://localhost says Wamp Server Offline as well.. Where can I check the directory where apache/localhost is active? Quote Link to comment https://forums.phpfreaks.com/topic/137049-localhost-shows-raw-php-code-wtf/#findComment-715816 Share on other sites More sharing options...
wildteen88 Posted December 15, 2008 Share Posted December 15, 2008 You should save all your PHP scripts and its resources (images/css/javascript etc) in C:/WAMP/www <-- this is where WAMP loads your files from when you access http://localhost Also ensure you're saving your PHP scripts as a .php file and not .html. By default PHP code will only be parsed within .php files, however this can be changed. Quote Link to comment https://forums.phpfreaks.com/topic/137049-localhost-shows-raw-php-code-wtf/#findComment-715979 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.