954,576 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Defining a PHP INI variable for entire directory

Hi!

I have a PHP application with alot of files, and I really needed an easy way out of this.

Most of the files call the session_start(); function. However, my /tmp space is too small, and so it keeps returning me errors.

I found out a work-around, by adding ini_set('session.save_handler','files'); before session_start();.

I really don't want to modify everything manually, so I needed some way of defining the session.save_handler variable for an entire directory.

Is it possible?


Thanks.

BoogaBooga
Newbie Poster
13 posts since Oct 2004
Reputation Points: 10
Solved Threads: 0
 

Create an .htaccess file in the directory you want to affect (and all subdirectories in it.)

The contents of .htaccess will be:

php_value session.save_handler files


Done.

Gary King
PHP/vBulletin Guru
Team Colleague
417 posts since Nov 2003
Reputation Points: 53
Solved Threads: 5
 

Thanks, will try :P

Knew it had something to do with htaccess :)

BoogaBooga
Newbie Poster
13 posts since Oct 2004
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You