jalpro Posted February 23, 2011 Posted February 23, 2011 Hey guys! New to Heliohost. This is the code that won't parse: <div id="newscontent" class="flexcroll"> <?php include("php/indexnews.php");?> </div> The same code is used on my old host, which, when viewing the source, would be replaced by the html in the indexnews.php file. But instead all I see is the original code. The php runs fine, because I can open the file using the browser address bar and it returns the data correctly. Help! Thanks
Byron Posted February 23, 2011 Posted February 23, 2011 Any pages using php need to have a .php extension. So the easiest solution would be to rename your page to index.php. If that's a problem for you and you have many pages on your site using php with a .html extension, you could add this piece of code to your root .htaccess file: AddHandler application/x-httpd-php5 .html Now all of your files ending in .html will be parsed for php.
jalpro Posted February 23, 2011 Author Posted February 23, 2011 Thanks! That worked! For anyone who is reading this post having the same problem, this is what my "/public_html/.htaccess" file looks like now: # -FrontPage- IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* <Limit GET POST> order deny,allow deny from all allow from all </Limit> <Limit PUT DELETE> order deny,allow deny from all </Limit> AuthName jalpro.heliohost.org AuthUserFile /home1/jalpro/public_html/_vti_pvt/service.pwd AuthGroupFile /home1/jalpro/public_html/_vti_pvt/service.grp AddHandler application/x-httpd-php5 .html Thanks
Guest Geoff Posted February 23, 2011 Posted February 23, 2011 Be aware that having php parse your html files is a performance hit.
jalpro Posted February 25, 2011 Author Posted February 25, 2011 Be aware that having php parse your html files is a performance hit. Explain...?
Byron Posted February 25, 2011 Posted February 25, 2011 It's really not that big of a deal. I'm sure your other site was set up the same way if html pages were parsing php. All it means is that all of your html pages will be parsed for php wether they use php or not. You'll probably never notice the difference.
jalpro Posted March 7, 2011 Author Posted March 7, 2011 It's really not that big of a deal. I'm sure your other site was set up the same way if html pages were parsing php. All it means is that all of your html pages will be parsed for php wether they use php or not. You'll probably never notice the difference. Very true! My longest PHP files are only around 20-40 lines long, which I very much doubt are going to take very long to parse. (Are comments ignored by the parser?) Besides, my last host was really slow, so Heliohost is a big improvement nevertheless!
Byron Posted March 7, 2011 Posted March 7, 2011 Your php pages want take any longer, just your html pages that don't have any php. But it probably want be any thing noticable.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now