Jump to content

[SOLVED] So the server I'm hosted on prompts me to download my PHP scripts


Goldeneye

Recommended Posts

 

When I was working on my site yesterday, it seemed to be working fine. Well actually, I got "PHP Fatal Error: Maximum execution time of 30 seconds exceeded." (or something to that effect). I would've investigated it but I was out of time.

 

Anyways I accessed my website today and it prompted me to download my PHP files. The strange part is that I accessed a different set of scripts on my website in a completely different directory, and they executed fine. So why could this be happening? Could it because of something in my .htaccess file? Or, a lot less likely, be something in my PHP scripts.

 

I should add that the .PHP file it offers you for download only has HTML in it, so it's being processed through the PHP engine before it reaches the user.

Link to comment
Share on other sites

Well I looked at all my scripts. And they seemed fine. So I went to my .htaccess file and am thinking it might be my error logging or GZip compression

 

edit:

 

my .htaccess

Options +FollowSymLinks
# Mod_Rewrtie #######################################
RewriteEngine on
RewriteBase /tipsi
## BOARDS ###########################################
###Rewrite conditions
# Mod_GZip ##########################################
php_flag zlib.output_compression on
php_value zlib.output_compression_level 4
AddHandler application/x-httpd-php .css .js
php_value auto_prepend_file /home/foo/bar/www/globals.contenttype.php
# LOGGING ###########################################
php_flag  log_errors on
php_value error_log  /home/foo/bar/logs/errors.log

 

Yet another edit:

 

my globals.contenttype.php

<?php
$pathinfo = pathinfo($_SERVER['PHP_SELF']);
$extension = $pathinfo['extension'];
if($extension == "php"){header("Content-type: application/x-httpd-php");}
if($extension == "css"){header("Content-type: text/css");}
if($extension == "js"){header("Content-type: text/javascript");}
?>

 

The globals.contenttype.php file exists to help correct any issues that come with compressing the files

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.