Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Ubuntu currently, also Fedora, RHEL, CentOS
Posts: 111
Rep:
Apache rending php when filename is x.php.html
I am not sure if this is a bug, or if there is an easy fix, but I am having issues with Apache and PHP.
Here's the problem
I make a file named test1.php
Code:
<?php
phpinfo();
?>
It spits out normal phpinfo stuff.
I rename that file to test1.php.html and point my browser to this new file.
It still renders as PHP. To me this is a bug. If the final extension is html it should render as text/html and not be passed to the PHP parser.
I am using FC6 if that helps at all. I don't remember seeing this problem on Ubuntu when I was doing something similar, though I am unsure how to force apache to only render based on last extension and not a pattern match.
There is a directive in the apache config where you can set what should be parsed as php. Rename file to test1.html; if it does the same thing, that certainly is what you should change. No apache server at hand to check.
Last edited by Wim Sturkenboom; 01-21-2007 at 10:34 AM.
Distribution: Ubuntu currently, also Fedora, RHEL, CentOS
Posts: 111
Original Poster
Rep:
Quote:
Originally Posted by Wim Sturkenboom
There is a directive in the apache config where you can set what should be parsed as php. Rename file to test1.html; if it does the same thing, that certainly is what you should change. No apache server at hand to check.
I realize this. This is the code from /etc/httpd/conf.d/php.conf. I don't see anywhere that says a file named my.php.thing.html should be rendered as php. When I disable PHP all together, of course the behavior is as expected.
Code:
PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
LoadModule php5_module modules/libphp5.so
#
# Cause the PHP interpreter to handle files with a .php extension.
#
AddHandler php5-script .php
AddType text/html .php
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.