Jump to content
xisto Community
Sign in to follow this  
rsf

Php Files Acting Up

Recommended Posts

I'm pretty sure this is a problem with the server, not my code. But I'm open for interpretations.Randomly I'll be uploading php files, and when I try and view them it takes a little longer to load and then asks me if I want to download the php file or not. Of course, I don't want people to download my php files.This just happens sporadically, I won't get it for a few days, and then one day I'll get it several times.Anyone had this problem before, or is there anything I can do with chmod or htaccess to allow people to view the file, but not download it?

Share this post


Link to post
Share on other sites

Please give an example of URL and perhaps you can post the file as well?PHP is server side ran script. So if it's downloading it's usually because the format was not compliant with PHP scripting--so it's interpreted as other file type.

Share this post


Link to post
Share on other sites

Ok thanks. I got the message again when I was writing some new code which I expected to still be buggy. I downloaded it just to see and the file it downloaded didn't have any contents. So I guess it's not a security issue, I just need to not release buggy pages so I don't annoy my users :P

Share this post


Link to post
Share on other sites

This happens to me when the server goes laggy for a few minutes. I write all my PHP scripts in PHP 4, which I believe Trap 17 and Xisto - Web Hosting has.

 

This sometimes happens as well if you have an iframe which keeps refreshing.

Example

<iframe src="page.php" name="mainframe"></iframe>

If there is a propper reason, please tell it here. I would love to know. And until then, I personaly believe it's just the server been laggy.

 

Also if the script uses MySQL this sometimes happens to me.

 

Have a great day!

 

-Tom

Share this post


Link to post
Share on other sites

had this on different hosters so i dont think its a serious problem... not very common aswell. i think it happens if the server needs too long to interprete the script and the browser just tries to download the file instead of displaying the phrazed code. shouldn?t happen too often i think (happened 3 times in my life xD)

Share this post


Link to post
Share on other sites

it has nothing to do with the fact that the server is "laggy".php is a server-side scripting language, therefore the content of a .php is parsed (interpreted) by the server. You cannot download a php file (the content of it). What you (should) get (called "output" :P ) is generally html files (but it can be an image, a pdf file etc.). This means that your files are not "seen" by the server as php files. First of all, be sure that your php files start with <?php (or<?) and end with ?> (the only quick tip that came into my mind :P )...

Edited by hts (see edit history)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.