Linux - Server This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
03-08-2011, 05:41 AM
|
#1
|
Member
Registered: Jul 2010
Posts: 83
Rep:
|
server offers PHP file for download on HTTP but is fine on HTTPS.
Hi Guys,
I wonder if you can help. I have a debian box running Apache2 and PHP5.2.6 lenny.
When a request is made via https, php displays the content fine. If the request is made over HTTP the file is offered for download, rather than displaying it.
I know its probably something trivial but I've never seen this issue.
Any ideas? Thanks.
EDIT: The plot thickens, I can display PHP over HTTP in some directories but not others (which offer the file for download)?
Last edited by Spuddy; 03-08-2011 at 06:49 AM.
Reason: More information.
|
|
|
03-08-2011, 06:52 AM
|
#2
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,216
|
Hi
Search for:
in a .htaccess in those directories, or in apache2.conf
Regards
|
|
|
03-08-2011, 07:03 AM
|
#3
|
Member
Registered: Jul 2010
Posts: 83
Original Poster
Rep:
|
Quote:
Originally Posted by bathory
Hi
Search for:
in a .htaccess in those directories, or in apache2.conf
Regards
|
Hi,
Thanks for the response, there are no .htaccess files and the php_flag command can't be found in apache2.conf
|
|
|
03-08-2011, 07:17 AM
|
#4
|
Member
Registered: Jul 2010
Posts: 83
Original Poster
Rep:
|
for example
http://1.2.3.4/a.php - does not work, offers a.php for download.
https://1.2.3.4/a.php - displays php info
http://1.2.3.4/a/a.php - displays php info
https://1.2.3.4/a/a.php - displays php info
http://1.2.3.4/utils/test.php - does not work, offers a.php for download.
https://1.2.3.4/utils/test.php - displays php info
Last edited by Spuddy; 03-08-2011 at 07:18 AM.
|
|
|
03-08-2011, 07:27 AM
|
#5
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,216
|
Are you sure it's not your browser cache?
This behavior is common if you miss
Quote:
AddType application/x-httpd-php .php
|
, but I guess here is not the case as it works sort of.
Anyway, you can create a .htaccess in the DocumentRoot (/var/www) containing:
as a workaround
Last edited by bathory; 03-08-2011 at 08:12 AM.
|
|
|
03-08-2011, 07:39 AM
|
#6
|
Member
Registered: Jul 2010
Posts: 83
Original Poster
Rep:
|
Quote:
Originally Posted by bathory
Are you sure it's not your browser cache?
This behavior is common if you miss
, but I guess here is not the case as it works sort of.
Anyway, you can create a .htaccess in the DocumentRoot (/var/www) containing:
as a workaround
|
Hi,
Created .htaccess file with just
within, restarted apache and same outcome. Browser cache is clear and using multiple browsers to check.
Thanks,
|
|
|
03-08-2011, 08:11 AM
|
#7
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,216
|
There is no need to restart apache after editing .htaccess.
Could be that apache does not read .htaccess files. You can /etc/apache2/sites-available/default (or whatever is the vhost file you're using) and make sure you have
|
|
|
03-08-2011, 09:31 AM
|
#8
|
Member
Registered: Jul 2010
Posts: 83
Original Poster
Rep:
|
Quote:
Originally Posted by bathory
There is no need to restart apache after editing .htaccess.
Could be that apache does not read .htaccess files. You can /etc/apache2/sites-available/default (or whatever is the vhost file you're using) and make sure you have
|
Hello AllowOverride All is present in /etc/apache2/sites-available/default.
|
|
|
03-08-2011, 10:09 AM
|
#9
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,216
|
May I ask why you marked the thread Solved?
|
|
|
03-08-2011, 11:10 AM
|
#10
|
Member
Registered: Jul 2010
Posts: 83
Original Poster
Rep:
|
Quote:
Originally Posted by bathory
May I ask why you marked the thread Solved?
|
Hi, sorry I meant to post the resolve but was side-tracked.
We found a device further down in the line in our network was web-caching on port 80, we disabled this and everything worked.
Thanks.
|
|
|
All times are GMT -5. The time now is 04:37 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|