homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

PHP interpreter problem
apache server

Msg#: 4279695 posted 4:39 pm on Mar 10, 2011 (gmt 0)

Hey I'm new to these forums.

I'm currently running an apache server. I installed PHP and the page index.php runs the html fine, but everything between the <?php ?> tags are ignored. they're not printed out on the webpage, and if you go to the file in vim they're highlighted (purple) correctly, but the php interpreter seems to be not working.

Also, when i uncomment the "addtype application/x-httpd-php .php" in the php.conf file the entire page goes completely blank.

thanks for all your help!



WebmasterWorld Senior Member rocknbil us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 4279695 posted 4:54 pm on Mar 10, 2011 (gmt 0)

If the page goes blank, it may be that your script has an error and error reporting is off (which is a good thing for security purposes.) Does this run?

echo "hello world";

Be sure there's no newlines after the closing ?>


Msg#: 4279695 posted 4:58 pm on Mar 10, 2011 (gmt 0)

hey rocknbil, thanks for the quick response!

unfortunately though, nope, absolutely nothing between php tags run with the addtype commented out, and with the addtype in the page is blank.


10+ Year Member

Msg#: 4279695 posted 5:02 pm on Mar 10, 2011 (gmt 0)

I had a similar issue recently on a new install which turned out to be that Apache wasn't loading PHP at all.

Have you found the PHP manual pages on the different types of PHP and the entries and formats needed for the Apache config file?

Guessing it is a new install. Which operating system are you running?


Msg#: 4279695 posted 5:02 pm on Mar 10, 2011 (gmt 0)

in case it helps, here's my php.conf file:

# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
<IfModule prefork.c>
LoadModule php5_module modules/libphp5.so
<IfModule worker.c>
# Use of the "ZTS" build with worker is experimental, and no shared
# modules are supported.
LoadModule php5_module modules/libphp5-zts.so

# Cause the PHP interpreter to handle files with a .php extension.
#AddHandler php5-script .php
AddType text/html .php
#AddType application/x-httpd-php .php

# Add index.php to the list of files that will be served as directory
# indexes.
#DirectoryIndex index.php

# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
AddType application/x-httpd-php-source .phps

ive tried every combination of the 3 addtype/addhander statements. when the addtype application or the addhandler is uncommented, the page is blank. i can leave the addtype text/html on and it still runs fine.


Msg#: 4279695 posted 5:03 pm on Mar 10, 2011 (gmt 0)

Oh, hi vordmeister, I'm running centos 5.0.


10+ Year Member

Msg#: 4279695 posted 5:10 pm on Mar 10, 2011 (gmt 0)

Don't know about Centos - for me the solution was in the file paths that needed to be included in the Apache hpptd.conf file. If you've read that part of the PHP manual you'll be ahead of me.


Msg#: 4279695 posted 5:27 pm on Mar 10, 2011 (gmt 0)

The problem is the interpreter, but I thought the "addtype" was the interpreter...and yet the addtype makes it go blank...


Msg#: 4279695 posted 5:46 pm on Mar 10, 2011 (gmt 0)

Ah! I solved it! there was a type in the addtype >.<

thanks for you responses!

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved