Jump to content

PHP Asking to Download instead of Execute on 2 PHP Pages


hawnted

Recommended Posts

I have a phpbb forum. At work on our network, starting yesterday, it asks to download 2 php pages of my site instead of exceuting and displaying the page. portal.php and index.php are the culprits. I can goto all other pages on the site fine. Up until yesterday they worked fine. Note that it is the same on our entire network. However, everyone else (including me from home) can see the pages fine. Things I have done since this started happening, made changes to a .htaccess file, and browsed to the site from an anonymous browser from work. Here is my .htaccess

 

DirectoryIndex index.html index.htm portal.php index.php

RewriteCond %{HTTP_HOST} ^mysite.com$ [OR]

 

Options +FollowSymlinks

RewriteEngine on

rewritecond %{http_host} ^mysite.com [nc]

rewriterule ^(.*)$ http://www.mysite.com/$1 [r=301,nc] '

 

I am on hostgator, using cpanel. They run PHP 5. The culprit site is an addon domain of my main domain. Please let me know if you need any other info to help resolve.

Link to comment
Share on other sites

Nope. Same problem. Lol I did not even think to try that though. That eliminates .htaccess as the problem. It seems like some kind of MIME issue. I wonder if I have to do some kind of AddType any other ideas?

Link to comment
Share on other sites

i assume the PHP file that downloaded is blank! (or atleast contains no php code)

 

if not then thats a BIG issule..

 

MIME type should be (close to)

application/x-httpd-php - php php3 php4 php5 php6

but that affects ALL php pages

 

try creating a test page

 

<?php
phpinfo();
?>

Link to comment
Share on other sites

There is definately code in it. Remember, those 2 files run fine and display fine everywhere but in my network. However, using the same code, installed on a different site it works fine in my network. for some reason there is something about that specific site that is not right, and whatever it is, its only apparent to browsers in my network at work.

Link to comment
Share on other sites

i mean, when it prompts you to download the files.. if you do download them (from that prompt) and then open the files in notepad (or textedit) does it still contain the code ? the file on the site will contain the code but does the download copy also contain it ?

Link to comment
Share on other sites

:o

Okay let me check the facts..

 

from outside your network, it parses fine (displays fine) but internal it shows the source code?

 

if this is the case then it seams more of a network structure or apache issule,

 

is the server at your office or at hostgator (what riole does hostgator play)

 

EDIT:

my mine is

application/x-httpd-php php php3 php4 php5 php6

not

application/x-httpd-php5 php php3 php4 php5 php6

 

also i have

application/x-httpd-php-source phps

phps ONLY

 

 

(sorry leaving work now, will check this post when i'm at home)

 

Link to comment
Share on other sites

Hostgator is my host, they have the server in their posession. It does seem more like a network thing but this only happened immediately after I deleted an .htaccess and brosed to the site from an anonymous browser. We are not on a proxy, and my cache is completely cleared. I kinda think its a network issue too but I was just wondering if someone can lead me down the right path of fixing it since the rest of the php pages display fine.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.