Reputation: 1
When I run localhost/filename.php
in the chrome web browser it does not display the output of the code using that filename but the underlying code. I have tried to eliminate as many of the possible factors, so I know that the same file works on a different mac when localhost/filename.php
is used. I have also tried to use it on the safari web browser - same problem.
I am running out of ideas of how to fix or narrow down the problem so I am just asking on the of chance someone has been in the same situation and knows how to fix it?
Upvotes: 0
Views: 1049
Reputation: 1560
I am assuming you have a mac and you are running on the latest version (Mac OS X Mountain Lion), assuming such, you will most likely have to install/enable php this is slightly more difficult than in previous versions of Mac OS X as apple has made some changes, but the link below shows it in pretty good detail, it allows you also to set up phpmyadmin and mysql in a local environment, it's what I used to set it up.
You can also do something easier and use sever software such as MAMP or XAMPP which are just a simple installer, however they don't offer as much freedom as installing it manually has (also not sure if they have mountain lion support yet)...
MAMP: http://www.mamp.info/de/mamp/index.html
XAMPP: http://www.apachefriends.org/en/xampp-macosx.html
Upvotes: 1
Reputation: 305
Your host is not executing the php so it is not an issue with the code but with PHP. Be sure your localhost is set to execute PHP otherwise it will show it as text.
Upvotes: 0