Khons Posted November 28, 2007 Share Posted November 28, 2007 When I try to open index.php through localhost, all I get is the text that is on the page. The includes and CSS are completely ignored. It would appear that the PHP code is being ignored completely, despite Apache running without a problem and the PHP installation package having added itself to httpd.conf . If it helps, I'm using Apache 2.2.6 with PHP 5.2.5 on Windows Vista. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/79263-solved-apache-226-php-52-not-rendering-php-files-correctly/ Share on other sites More sharing options...
trq Posted November 28, 2007 Share Posted November 28, 2007 all I get is the text that is on the page. When you say the text, do you mean the php code? Quote Link to comment https://forums.phpfreaks.com/topic/79263-solved-apache-226-php-52-not-rendering-php-files-correctly/#findComment-401224 Share on other sites More sharing options...
todding01 Posted November 28, 2007 Share Posted November 28, 2007 Did you restart Apache after the PHP installation? Quote Link to comment https://forums.phpfreaks.com/topic/79263-solved-apache-226-php-52-not-rendering-php-files-correctly/#findComment-401233 Share on other sites More sharing options...
lukinagin Posted November 28, 2007 Share Posted November 28, 2007 The PHP installation will add in LoadModule directive in the httpd.conf file but will not add in the AddType to tell Apache to handle files with PHP extensions. If you haven't already done so, add in the following to your httpd.conf file: # Add PHP support AddType application/x-httpd-php .php Restart Apache then try your URL again. Quote Link to comment https://forums.phpfreaks.com/topic/79263-solved-apache-226-php-52-not-rendering-php-files-correctly/#findComment-401311 Share on other sites More sharing options...
Khons Posted November 29, 2007 Author Share Posted November 29, 2007 The PHP installation will add in LoadModule directive in the httpd.conf file but will not add in the AddType to tell Apache to handle files with PHP extensions. If you haven't already done so, add in the following to your httpd.conf file: # Add PHP support AddType application/x-httpd-php .php Restart Apache then try your URL again. I added the line, restarted the server, same thing When you say the text, do you mean the php code?No, not the PHP code itself, but the basic text that is on the page. CSS objects, text links which are put on the page by using include, etc are not displayed. Quote Link to comment https://forums.phpfreaks.com/topic/79263-solved-apache-226-php-52-not-rendering-php-files-correctly/#findComment-401860 Share on other sites More sharing options...
PFMaBiSmAd Posted November 29, 2007 Share Posted November 29, 2007 Check your web server log for errors and/or turn on full php error reporting in php.ini or a .htaccess file to get php to help you. Post your code as it is likely that you are doing something in it that is preventing php from outputting anything (such as using short open tags <?) Quote Link to comment https://forums.phpfreaks.com/topic/79263-solved-apache-226-php-52-not-rendering-php-files-correctly/#findComment-401911 Share on other sites More sharing options...
Khons Posted November 29, 2007 Author Share Posted November 29, 2007 I checked the Apache log, but I can't see anything too obvious. I uploaded the error log to http://www.indigetesdii.org/stuff/apache/error.txt . I turned on error reporting in php.ini but it tells me nothing when I try to open index.php. It just shows me the text on the page, and that's it. The index.php file code is as follows, and can be seen in action at http://www.indigetesdii.org . Locally (Apache) I only see the "to-morrow, and to-morrow, (...) signifying nothing." text. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <? include "css.php" ?> <title>indigetesdii.org :: humanity has failed</title> </head> <body> <div id="bg1-index"></div> <div id="bg2-index"></div> <div id="header"> <table width="100%" height="100%" border="0"> <tr> <td width="100%" height="100%" align="center" valign="middle"> <img src="id/img/indigetesdii.jpg" /> </td> </tr> </table> </div> <div id="main"> <p class="home"> <b> To-morrow, and to-morrow, and to-morrow,<br /> Creeps on this petty pace from day to day,<br /> To the last syllable of recorded time;<br /> And all our yesterdays have lighted fools<br /> The way to dusty death. Out, out, brief candle!<br /><br /> Life's but a walking shadow; a poor player,<br /> That struts and frets his hour upon the stage,<br /> And then is heard no more: it is a tale<br /> Told by an idiot, full of sound and fury,<br /> Signifying nothing. </b> </p> </div> <div id="menu"> <p class="menu-top"> <b>HUMANITY HAS FAILED</b> </p> <p class="menu-bottom"> :: <a href="id/index.php">home</a> :: <a href="id/news.php">news</a> :: <a href="id/releases.php">releases</a> :: <a href="id/media.php">media</a> :: <a href="mailto:[-removeme-]info@indigetesdii.org" target="_blank">contact</a> :: <a href="http://www.myspace.com/indigetesdii" target="_blank">myspace</a> :: </p> </div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/79263-solved-apache-226-php-52-not-rendering-php-files-correctly/#findComment-402212 Share on other sites More sharing options...
PFMaBiSmAd Posted November 29, 2007 Share Posted November 29, 2007 The previous post above contains the answer (in bold) - Post your code as it is likely that you are doing something in it that is preventing php from outputting anything (such as using short open tags <?) Quote Link to comment https://forums.phpfreaks.com/topic/79263-solved-apache-226-php-52-not-rendering-php-files-correctly/#findComment-402216 Share on other sites More sharing options...
Khons Posted November 30, 2007 Author Share Posted November 30, 2007 Ah, I thought that "open tags" meant "unclosed" tags, rather than proper tags. That'll teach me not looking up things I think I still know from a few years ago - I totally forgot that <? was a short version... Thanks for all the help and advice. I'll be sure to double-check any new code I might add! Quote Link to comment https://forums.phpfreaks.com/topic/79263-solved-apache-226-php-52-not-rendering-php-files-correctly/#findComment-402692 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.