Squirrelmail downloads php file instead of displaying i

nobaloney

NoBaloney Internet Svcs - In Memoriam †
Joined
Jun 16, 2003
Messages
24,989
Location
California
I've been having problems lately with Squirrelmail downloading php files instead of displaying them. l It's only occasionally, and if I click again it often works.

I have no idea what could be causing this but I updated the entire server today using custombuild.

php4 as cli (mod_php)

Any ideas?

Thanks.

Jeff
 
Hi,

ive looked around on internet and seems that other people having same issue with squirrelmail, bad is no one got a working answer for now.

I would suggest you to try with .htaccess file in squirrelmail root directory with this inside:

Code:
<FilesMatch "\.(inc|php|php3|php4|php5|php6|phtml|phps)$">
AddHandler x-httpd-php5 .php5
AddHandler x-httpd-php4 .inc .php .php3 .php4 .phtml
</FilesMatch>

Online ive read is an apache problem on configuration or on handling the php files.. is trange.. i would more suppose is a squirrelmail issue if is the only place where this problem appear.

Let me know.

Regards
 
Hello,

If you're getting raw php code, then apache/php didn't send it to the correct handler. In theory, if it were a config issue, it should be generating the issue every time. When issues are random, that tends to imply a c code bug (not with the SM php script).... memory going places it shouldn't.. or something like that. If it is a php code bug.. php4 is EOL (end of life), so there won't be any fixes for it, and you'd have to update to php5.

I'm not sure, but it might also be the ram, if it's not saving things correctly, going on the similar theory of memory corruption as before, just by a different means. (this is just a random guess).

However, if there have been other reports of the same issue (with it showing code randomly), the it's more likely a bug in php itself. In theory, nothing Squirrelmail does should cause it to spit out raw code.. (php is supposed to throw it's own errors) However, it's possible that the conditions to duplciate the php bug are only done by SquirrelMail, thus exposing the php4 issue.. as SM is a fairly complex bit of php coding using the more advanced features of php.

Again, this is all "in theory" .. and my best guess... If it's true, you can only update to php5, as php4 is EOL. (EOL=SOL ;))

John
 
Other things to try:
- php4 as suPhp
- different versions of php4
- different versions of SM

@SeLLeRoNe: The link provided would only apply if they're also getting raw downloads at random times. I belive Jeff mentioned it's random, but the link referenced seems to be describing it as always downloading the raw script, every time (correct me if I'm wrong). If it happens every time, then it's a basic httpd.conf or .htaccess file issue (something ./build rewrite_confs should fix). Anytime things happen randomly, it brings the game to a new level, as it tends to imply something much lower down is going wrong.

John
 
Thanks, everyone. I'm setting up php5 as an option on the server and will try running squirrelmail under php5 as well. I'll be back with more information as I have it.

Jeff
 
I thought that I read somewhere that I could install both php4 and php5 as CLI, I get this:
Code:
Cannot install PHP4 and PHP5 as CLI.
So now I'll set up PHP5 as CGI, and post back soon.

Jeff
 
I've installed php5 as cgi, and I've tried this in the /var/www/html/.htaccess file:
Code:
<FilesMatch "\.(inc|php|php3|php4|php5|php6|phtml|phps)$">
AddHandler x-httpd-php4 .php4
AddHandler x-httpd-php5 .inc .php .php3 .php5 .phtml
</FilesMatch>
When I try squirrelmail I get a black background filling my browser window, but when I try squirrelmail I get this error message:
Code:
ERROR: Config file ' . '"config/config.php" not found. You need to ' . 'configure SquirrelMail before you can use it.
'; exit; } // If we are, go ahead to the login page. header('Location: src/login.php'); ?>
When I try phpinfophp I get a blank screen but when I look at source I get:
Code:
<?php
phpinfo();
?>
Taking the lines out of .htaccess of course gets me back to php4 and things work, but of course squirrelmail still has the intermittent problem.

Any ideas?

Thanks.

Jeff
 
Have you tryed to put .htaccess file into squirrelmail directory?
Can you send me login data? I would take a look into this if you want.

Regards
 
Yes, I've tried .htaccess in the squirrelmail, though it shouldn't make a difference.

Thank you for your offer. I'll consider it.

Jeff
 
@Jeff,

Make sure, you've got

Code:
[handlers]
;Handler for php-scripts
x-httpd-php4="php:/usr/local/php4/bin/php"
x-httpd-php5="php:/usr/local/php5/bin/php-cgi"

in /usr/local/suphp/etc/suphp.conf


and

Code:
suPHP_AddHandler x-httpd-php4
suPHP_AddHandler x-httpd-php5

in /etc/httpd/conf/extra/httpd-suphp.conf
 
Back
Top