Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
PHP file only shows source code on localhost.
Post Body

I'm on OSX and I've had this issue with both of my computers, I run MAMP XAMPP on one and activated PHP and Apache at the terminal on my other computer. I was testing out html locally and decided to add some php, saved it as .php, and refreshed the browser only to get source code info. I've googled the issue and it still doesn't seem to help. I should note that when I first did the install on both of these computers they worked fine. I've tried all on the httpd.conf file in my /etc/apache2/ dir:

Uncommenting php5 in httpd.conf (obvies)

No idea what these are doing here, is there a modules dir I should find? I added them in anyway and still no change...

AddModule mod_php.c

LoadModule php_module modules/mod_php.so

LoadModule php5_module modules/libphp5.so

I've even tried using AddHandler instead of AddType but no difference...

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

I don't think it has anything to do with the short_open_tag thing since <?php echo info() ?> doesn't even work. Anything I'm missing? Could be super basic, like even 'hey you should be saving all your files in a certain directory' or something, it's been awhile since I've done this stuff, I did restart apache however and no change.

Again, it worked initially and I haven't changed anything so I'm really not sure, could it have something to do with a conflicting install or something?

Author
Account Strength
100%
Account Age
12 years
Verified Email
Yes
Verified Flair
No
Total Karma
7,985
Link Karma
7,198
Comment Karma
787
Profile updated: 6 days ago
Posts updated: 8 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
11 years ago