<?php
phpinfo;
?>
should be
<?php
phpinfo();
?>
Note the () after phpinfo
I've just installed RH8, with Apache 2.0 and PHP 4.2. Apache works fine, but PHP doesn't appear to be doing anything at all. I've dropped a page called phpinfo.php with the following code:
but i get a blank page. Viewing the source of the page shows code above. I have more complicated pages, with results of db queries being displayed, and these are broken on this webserver too. They work fine on the old Apache 1.3/PHP 4.1 server. Any ideas as to why I am able to view php pages, but only able to see html code on such pages, and not the php code? My /etc/httpd/conf.d/php.conf file is below, and I have checked that the libphp4.so file is where it should be.Code:<?php phpinfo; ?>
Code:# # PHP is an HTML-embedded scripting language which attempts to make it # easy for developers to write dynamically generated webpages. # LoadModule php4_module modules/libphp4.so # # Cause the PHP interpreter handle files with a .php extension. # <Files *.php> SetOutputFilter PHP SetInputFilter PHP LimitRequestBody 524288 </Files> # # Add index.php to the list of files that will be served as directory # indexes. # DirectoryIndex index.php
<?php
phpinfo;
?>
should be
<?php
phpinfo();
?>
Note the () after phpinfo
Check your httpd.conf file, i'm not sure where it is in RH, but it should have all of the following lines in it somewhere:
and if you want apache to direct to index.php as well as index.html, addCode:AddModule mod_php4.c AddType application/x-httpd-php .php .php3
With that in there it should work, although after editing the text file you will need to restart apache.Code:<IfModule mod_dir.c> DirectoryIndex index.php index.html </IfModule>
ph34r - oops, that was a typo, in the post. I had the "()" in the script.
PK - Not 100% on this, but my understanding is that in Apache 2.0, all this stuff goes in the .conf files in /path_to_apache/conf.d/ . httpd.conf has a line "Include ../conf.d/*.conf" or similar.
I'm struggling with Bind 9 at the mome, but am going to attempt to build these from source, see what happens.
Thanks,
David.
[quote author=Pleiades link=board=4;threadid=6381;start=0#60396 date=1045649065]
PK - Not 100% on this, but my understanding is that in Apache 2.0, all this stuff goes in the .conf files in /path_to_apache/conf.d/ . httpd.conf has a line "Include ../conf.d/*.conf" or similar.
[/quote]
Could be wrong, but i would guess that that's a RH thing, not an apache 2 thing, they tend to like to change config files i have founddo make sure that those lines are somehow getting included somehow though, how they are included shouldn't really matter.
Bookmarks