| View previous topic :: View next topic |
| Author |
Message |
deemo
Joined: 10 Mar 2007 Posts: 2
|
Posted: Mon Mar 12, 2007 14:25 Post subject: session.save_path won't update |
|
|
I have set the session.save_path = /tmp in the php.ini, saved the file, and restarted my OSX web server on numerous occasions. When I check the phpinfo (), session.save_path shows "no value". I have created a new directory (/phptmp) and set it in the php.ini file as the session.save_path, saved the php.ini file, restarted web server and still "no value" shows in the php info.
Does any one know why the value is not accepted?
TIA for the info.
Entropy PHP version 5.2.1
Mac x-serve with OS 10.4.8 |
|
| Back to top |
|
 |
kfaulhaber

Joined: 06 Aug 2003 Posts: 110 Location: ~/Living Room
|
Posted: Mon Mar 12, 2007 23:09 Post subject: |
|
|
| You made the changes to the same php.ini shown in phpinfo(), yes? |
|
| Back to top |
|
 |
deemo
Joined: 10 Mar 2007 Posts: 2
|
Posted: Tue Mar 13, 2007 21:28 Post subject: |
|
|
Yes. I did sudo vi /usr/local/php5/lib/php.ini edited and saved the file, checked the timestamp that it was written, stopped and restarted webserver, then checked phpinfo (), which showed "no value".
Reopened the php.ini file and saw the revisions I made in the file:
session.save_path = /tmp (and at one time, a new directory I created, /phptmp - which also didn't work)
entropy PHP ver. 5.2.1
Mac Xserve with 10.4.8
Thanks for the response - I'm at a loss as it should be 'all good' |
|
| Back to top |
|
 |
kfaulhaber

Joined: 06 Aug 2003 Posts: 110 Location: ~/Living Room
|
Posted: Tue Mar 13, 2007 21:49 Post subject: |
|
|
| Do other changes you have made to the ini go unrecognized? |
|
| Back to top |
|
 |
philipo
Joined: 06 Feb 2007 Posts: 5
|
Posted: Wed Mar 14, 2007 3:50 Post subject: |
|
|
Some debugging questions:
1. Are you checking phpinfo() in shell or via the web server (browser)
2. In phpinfo() what EXACTLY does the value for this say? "Configuration File (php.ini) Path"
3. Perhaps you have multiple web servers installed, so the one in the preference panel is restarting the "incorrect" one? Unlikely.
4. Does your web servers error log anything after restart? Try something like "tail -f /var/log/httpd/error_log" and then restart it, see what it says.
5. Maybe another ini file in "Scan this dir for additional .ini files" is affecting this, or in httpd.conf
6. Do as kfaulhaber suggests, try another, something is not right here
7. Be sure the directory you set, that PHP (the httpd user) has proper rights to it (although this would not explain your issue)
8. Well, those are the only ideas I can think of for now  |
|
| Back to top |
|
 |
anamorph
Joined: 04 May 2007 Posts: 1
|
Posted: Mon May 07, 2007 7:55 Post subject: |
|
|
hello.
As the PHP manual suggests, sessions should be stored in a different directory than /tmp; threrefore you should change it in your php.ini:
| Code: | session.save_path ="6;/usr/local/php5/sessions/"
|
Once this is done, verify that the directory exists:
| Code: | eve:~ nicolas$ ls -ld /usr/local/php5/sessions/
drwxrwxrwx 4 www www 136 May 7 08:40 /usr/local/php5/sessions/
|
if it doesn't exist, then create it with the correct permissions for the www user (or whichever user you run apache as) to write in there.
Once this is done, there should be (Entropy's PHP version doesn't have it, bad bad monkey !) a shell called mod_shell.sh in the /usr/local/php5/ext/sessions folder, and since it is not there ... we'll create it. This shell will create the foldertree under your sessions directory according to the depth you specified in the php.ini file (in my example, 6 levels).
here's the mod_files.sh source:
| Code: | #! /bin/sh
if test "$2" = ""; then
echo "usage: $0 basedir depth"
exit 1
fi
if test "$2" = "0"; then
exit 0
fi
hash_chars="0 1 2 3 4 5 6 7 8 9 a b c d e f"
if test "$3" -a "$3" -ge "5"; then
hash_chars="$hash_chars g h i j k l m n o p q r s t u v"
if test "$3" -eq "6"; then
hash_chars="$hash_chars w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z - ,"
fi
fi
for i in $hash_chars; do
newpath="$1/$i"
mkdir $newpath || exit 1
sh $0 $newpath `expr $2 - 1` $3
done
|
copy/paste it to a new file in your sessions directory, chmod it to 755 and run it like so:
| Code: | eve:~ nicolas$ sudo ./mod_files.sh /usr/local/php5/sessions/ 6
|
this will take some time depending on the depth of the foldertree (6 levels is way deep), but once it's done running, you're done.
voilą ! |
|
| Back to top |
|
 |
|