php code showing in html pages

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
barb woolums
Forum Contributor
Posts: 134
Joined: Sun Feb 08, 2009 9:52 pm

php code showing in html pages

Post by barb woolums »

Just upgraded to php 5.4 and now my php code is displaying in my html pages even though I have the following directive in my .htaccess file

AddType application/x-httpd-php5 .html .htm

Any ideas?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: php code showing in html pages

Post by requinix »

Do regular .php files work?

If not then PHP isn't installed. If so then you might have to use "application/x-httpd-php" as the file type.
User avatar
barb woolums
Forum Contributor
Posts: 134
Joined: Sun Feb 08, 2009 9:52 pm

Re: php code showing in html pages

Post by barb woolums »

Hmmm .php files don't work. Guess I'll have to reinstall my wamp stack again. - Thanks
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: php code showing in html pages

Post by twinedev »

what if you do php -version on the command line?
User avatar
barb woolums
Forum Contributor
Posts: 134
Joined: Sun Feb 08, 2009 9:52 pm

Re: php code showing in html pages

Post by barb woolums »

Now my .php pages are working, but still have the same issue with html paages.

tried php -version and got a syntax error
User avatar
barb woolums
Forum Contributor
Posts: 134
Joined: Sun Feb 08, 2009 9:52 pm

Re: php code showing in html pages

Post by barb woolums »

phpinfo shows correct version
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: php code showing in html pages

Post by Benjamin »

Are you using short tags?
Post Reply