My ISP switched to something called PHPSuExec in order to be more secure and avoid attacks. What it does is execute the php scripts using your user ID, and not the Apache user ID.

For Drupal users, the symptom will be that no cookies would be set for your site in the browser. If you create a file called phpinfo.php and put the following in it:

phpinfo() ;

And then execute it by visiting your web site http://example.com/phpinfo.php, you will find that under the session section, the session.cookie_lifetime and session.gc_maxlifetime will not be set to 200000.

If this is the case, then contact your ISP and confirm that they are using PHPSuExec. If they are, you need to create a new file called php.ini and put it in the same directory that you have .htaccess in.

This file will contain the following:

; This php.ini files is required when using PHPSuExec. 
;
register_globals                = 0
track_vars                      = 1
short_open_tag                  = 1
magic_quotes_gpc                = 0
magic_quotes_runtime            = 0
magic_quotes_sybase             = 0
arg_separator.output            = "&"
session.cache_expire            = 200000
session.gc_maxlifetime          = 200000
session.cookie_lifetime         = 604800
session.auto_start              = 0
session.save_handler            = user
session.cache_limiter           = none
allow_call_time_pass_reference  = On

Adjust the 604800 to your needs. It is the number of seconds the session is valid for. After that time has expired (7 days in the above example), users will be requried to log in again.

Comments

Travis’s picture

My ISP recently switched to phpsuexec as well. I've heard about ISPs switching to phpsuexec from a few other folks. I wonder if a PHP.INI should be distributed with the default drupal install? It doesn't do anything unless the user's ISP is running phpsuexec, so it wouldn't hurt anything to include it.

-t-