HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   General (
-   -   Squirrelmail downloads file... (

vibrancy 26th March 2011 21:33

Squirrelmail downloads file...
Main hard drive on my server crashed the other day, so finally get to upgrade to Debian 6 and ISPConfig3 - i'm excited!

Spent most of yesterday fiddling around and getting acclimated to the new system and I had pretty much everything working flawlessly. I was able to send/receive e-mails no problem, access websites, etc...

Today though, nothing has changed mind you... now when I try to access my webmail it downloads a file instead of going to the site. Absolutely no settings have been changed manually... so what is going on here?

You can see what I mean... any help would be greatly appreciated!

Found another thread mentioning the same issue, although his resolution was just simply reinstalling everything, which is not a great solution =\

I did make sure PHP is enabled for the site, have tried a few different settings all to no avail, tried FAST-cgi, mod-PHP, and suPHP but none worked, also checked permissions and "chmod 770 /var/lib/squirrelmail/data/" but nothing again... same result regardless of entering ip address vs domain name...

falko 27th March 2011 21:23

Can you post the vhost confoguration of the vhost?

What's the output of

ls -la
in the document root of the web site?

Ovidiu 14th April 2011 12:11

exactly the same problem here. test it here:
file gets downloaded and the content of that file says:



 * index.php
 * Redirects to the login page.
 * @copyright 1999-2010 The SquirrelMail Project Team
 * @license GNU Public License
 * @version $Id: index.php 13893 2010-01-25 02:47:41Z pdontthink $
 * @package squirrelmail

// Are we configured yet?
if( ! file_exists ( 'config/config.php' ) ) {
    echo '<html><body><p><strong>ERROR:</strong> Config file ' .
        '&quot;<tt>config/config.php</tt>&quot; not found. You need to ' .
        'configure SquirrelMail before you can use it.</p></body></html>';

// If we are, go ahead to the login page.
header('Location: src/login.php');


but the webmail can perfectly fine be accessed via:

the vhost of is:


<Directory /var/www/>
    AllowOverride None
    Order Deny,Allow
    Deny from all

<VirtualHost *:80>
      DocumentRoot /var/www/

    ServerAlias *
    ServerAlias *

    ErrorLog /var/log/ispconfig/httpd/

    <Directory /var/www/>
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    <Directory /var/www/clients/client1/web1/web>
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all

    # suexec enabled
    SuexecUserGroup web1 client1
    # Clear PHP settings of this website
    <FilesMatch "\.ph(p3?|tml)$">
        SetHandler None
    # php as fast-cgi enabled
    <IfModule mod_fcgid.c>

          # SocketPath /tmp/fcgid_sock/

          # IdleTimeout n (3600 seconds)
          # An idle fastcgi application will be terminated after IdleTimeout seconds.
      IdleTimeout 3600

          # ProcessLifeTime n (7200 seconds)
      # A fastcgi application will be terminated if lifetime expired, even no error is detected.
      ProcessLifeTime 7200

          # MaxProcessCount n (1000)
      # The max count of total fastcgi process count.
      # MaxProcessCount 1000

          # DefaultMinClassProcessCount n (3)
      # The minimum number of fastcgi application instances for any one fastcgi application.
      # Idle fastcgi will not be killed if their count is less than n
      # Set this to 0, and tweak IdleTimeout
          DefaultMinClassProcessCount 0

          # DefaultMaxClassProcessCount n (100)
      # The maximum number of fastcgi application instances allowed to run for
      # particular one fastcgi application.
      DefaultMaxClassProcessCount 100

          # IPCConnectTimeout n (3 seconds)
      # The connect timeout to a fastcgi application.
      IPCConnectTimeout 8

          # IPCCommTimeout n (20 seconds)
      # The communication timeout to a fastcgi application. Please increase this
      # value if your CGI have a slow initialization or slow respond.
      IPCCommTimeout 360

          # BusyTimeout n (300 seconds)
      # A fastcgi application will be terminated if handing a single request
      # longer than busy timeout.
          BusyTimeout 300

    <Directory /var/www/>
        AddHandler fcgid-script .php .php3 .php4 .php5
        FCGIWrapper /var/www/php-fcgi-scripts/web1/.php-fcgi-starter .php
        Options +ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
        <Directory /var/www/clients/client1/web1/web>
        AddHandler fcgid-script .php .php3 .php4 .php5
        FCGIWrapper /var/www/php-fcgi-scripts/web1/.php-fcgi-starter .php
        Options +ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all

    RewriteEngine on
    RewriteCond %{HTTP_HOST}  ^ [NC]
    RewriteRule  ^/(.*)$ /fisiere/$1  [L]

    # add support for apache mpm_itk
    <IfModule mpm_itk_module>
      AssignUserId web1 client1

    <IfModule mod_dav_fs.c>
      # WEBDAV END
<IfModule mod_fcgid.c>
  IPCConnectTimeout 300
  IPCCommTimeout 360
  MaxRequestLen 16777216

and the ls -al of the root web folder is too long to post here, what specifically are you looking for?

btw. I followed this howto:

maybe this info helps:


h1870666:/etc/squirrelmail# ls -al
total 80
drwxr-xr-x  2 root root  4096 Apr 14 10:57 .
drwxr-xr-x 108 root root  4096 Apr 14 10:35 ..
-rw-r--r--  1 root root  1145 Mar  6 18:52 apache.conf
lrwxrwxrwx  1 root root    7 Apr 14 10:57 config -> config/
-rw-r--r--  1 root root 31242 Jul 31  2010 config_default.php
-rw-r--r--  1 root root  459 Jul 31  2010 config_local.php
-rw-r--r--  1 root root  8401 Mar  6 18:44 config.php
lrwxrwxrwx  1 root root    32 Mar  6 18:43 -> /usr/sbin/squirrelmail-configure
-rw-r--r--  1 root root    41 Jul 31  2010 default_pref
-rw-r--r--  1 root root  6583 Jul 31  2010 filters_setup.php
-rw-r--r--  1 root root  478 Jul 31  2010 index.php
-rw-r--r--  1 root root  1654 Jul 31  2010 sqspell_config.php
h1870666:/etc/squirrelmail# cd config
bash: cd: config: Too many levels of symbolic links

oh and I do have added the right entries /user/share/squirelmail and /etc/squirrelmail to my php_open_base_dir variable.
also fixed the above symlinks problem by removing and re-installing squirrelmail according to the ispcfg3 tutorial..

falko 15th April 2011 15:01

Does it work with mod_php?

Ovidiu 16th April 2011 01:11

how would I test that? The squirrelmail config file for apache loads as an alias for all sites...
I don't want to set all my sites to mod_php :-)

I have set one site to mod_php, waited for the changes to be saved to file and tried: still the same result...

Ovidiu 21st April 2011 15:42

any other ideas?

Ovidiu 12th May 2011 15:17

nothing? sorry for bumping again, will just leave it be if I don't get an answer this time :-(

erosbk 12th May 2011 21:44

AddHandler application /x-httpd-php .php .php3 .php4 .php5

You have to add that line in the conf file of squirrelmail (for roundcube, I used an htaccess file in program folder.)

That line force squirrelmail to use php_mod instead of xxx_mod configured in your virtual sites.

till 13th May 2011 10:55

Another solution is to edit the file:


and change the lines:

AddType application/x-httpd-suphp .php .php3 .php4 .php5 .phtml
suPHP_AddHandler application/x-httpd-suphp


#AddType application/x-httpd-suphp .php .php3 .php4 .php5 .phtml
#suPHP_AddHandler application/x-httpd-suphp

and then restart apache.

Ovidiu 13th May 2011 16:55

didn't work, any other ideas or did I do anything wrong?

here is my squirrelmail conf file:

Alias /webmail /usr/share/squirrelmail

<Directory /usr/share/squirrelmail>
AddHandler application /x-httpd-php .php .php3 .php4 .php5
Options FollowSymLinks
<IfModule mod_php5.c>
php_flag register_globals off
<IfModule mod_dir.c>
DirectoryIndex index.php

# access to configtest is limited by default to prevent information leak
<Files configtest.php>
order deny,allow
deny from all
allow from

All times are GMT +2. The time now is 02:13.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.