homepage Welcome to WebmasterWorld Guest from 54.235.227.60
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
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
gavman




msg:4279697
 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!

 

rocknbil




msg:4279708
 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?

<?php
echo "hello world";
?>

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

gavman




msg:4279709
 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.

vordmeister




msg:4279713
 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?

gavman




msg:4279714
 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>
<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
</IfModule>

#
# 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.

gavman




msg:4279715
 5:03 pm on Mar 10, 2011 (gmt 0)

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

vordmeister




msg:4279724
 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.

gavman




msg:4279738
 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...

gavman




msg:4279752
 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