hawnted Posted May 30, 2008 Share Posted May 30, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/108021-php-asking-to-download-instead-of-execute-on-2-php-pages/ Share on other sites More sharing options...
MadTechie Posted May 30, 2008 Share Posted May 30, 2008 If theirs a delay before it starts the download, i would assume its timing out. i am not great at rewites but from a regex point of view this doesn't look right. rewriterule ^(.*)$ http://www.mysite.com/$1 [r=301,nc] ' Quote Link to comment https://forums.phpfreaks.com/topic/108021-php-asking-to-download-instead-of-execute-on-2-php-pages/#findComment-553636 Share on other sites More sharing options...
hawnted Posted May 30, 2008 Author Share Posted May 30, 2008 Its instantly downloading. The rewrite code in the .htaccess is written by hostgator when you setup a redirect to www in cpanel. It looks right from my searches. Any other ideas? Thanks for the reply- Quote Link to comment https://forums.phpfreaks.com/topic/108021-php-asking-to-download-instead-of-execute-on-2-php-pages/#findComment-553646 Share on other sites More sharing options...
MadTechie Posted May 30, 2008 Share Posted May 30, 2008 does it run okay without the .htaccess file ? EDIT: it maybe worth opening a ticket with hostgator as well, (cover both angles) Quote Link to comment https://forums.phpfreaks.com/topic/108021-php-asking-to-download-instead-of-execute-on-2-php-pages/#findComment-553649 Share on other sites More sharing options...
hawnted Posted May 30, 2008 Author Share Posted May 30, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/108021-php-asking-to-download-instead-of-execute-on-2-php-pages/#findComment-553651 Share on other sites More sharing options...
MadTechie Posted May 30, 2008 Share Posted May 30, 2008 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(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/108021-php-asking-to-download-instead-of-execute-on-2-php-pages/#findComment-553665 Share on other sites More sharing options...
hawnted Posted May 30, 2008 Author Share Posted May 30, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/108021-php-asking-to-download-instead-of-execute-on-2-php-pages/#findComment-553672 Share on other sites More sharing options...
MadTechie Posted May 30, 2008 Share Posted May 30, 2008 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 ? Quote Link to comment https://forums.phpfreaks.com/topic/108021-php-asking-to-download-instead-of-execute-on-2-php-pages/#findComment-553674 Share on other sites More sharing options...
hawnted Posted May 30, 2008 Author Share Posted May 30, 2008 Yes the downloaded file is identical to the code that is in the actual file. I did a diff. Quote Link to comment https://forums.phpfreaks.com/topic/108021-php-asking-to-download-instead-of-execute-on-2-php-pages/#findComment-553676 Share on other sites More sharing options...
hawnted Posted May 30, 2008 Author Share Posted May 30, 2008 In firefox it says You have chosen to open which is a:" application/x-httpd-php5 from http://mysite.com What should Firefox do with this file? Open with BROWSE Save to Disk Pretty much the same in IE7 so its not browser specific. Quote Link to comment https://forums.phpfreaks.com/topic/108021-php-asking-to-download-instead-of-execute-on-2-php-pages/#findComment-553682 Share on other sites More sharing options...
MadTechie Posted May 30, 2008 Share Posted May 30, 2008 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) Quote Link to comment https://forums.phpfreaks.com/topic/108021-php-asking-to-download-instead-of-execute-on-2-php-pages/#findComment-553690 Share on other sites More sharing options...
hawnted Posted May 30, 2008 Author Share Posted May 30, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/108021-php-asking-to-download-instead-of-execute-on-2-php-pages/#findComment-553698 Share on other sites More sharing options...
hawnted Posted May 30, 2008 Author Share Posted May 30, 2008 Made some more headway. If I goto www.mymaindomain.com/addondomain it works. If I goto www.myaddondomain.com it does not. Same code just different way of accessing. Its how hostgator does addon domains. Quote Link to comment https://forums.phpfreaks.com/topic/108021-php-asking-to-download-instead-of-execute-on-2-php-pages/#findComment-553702 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.