 |
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6  | This is the forum to discuss the Wrox book Beginning PHP, Apache, MySQLWeb Development by Michael K. Glass, Yann Le Scouarnec, Elizabeth Naramore, Gary Mailer, Jeremy Stolz, Jason Gerner; ISBN: 9780764557446 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

January 30th, 2005, 06:03 PM
|
|
Registered User
|
|
Join Date: Oct 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
PHP.ini and session.save_path variable
I am running Apache/2.0.52(Win32)PHP/4.3.9 on a Windows XP Machine with NO IIS installed.
I believe I have installed AMP successfully and have just successfully done the Try It Out - Passing the Visitors' Username Exercise on Page 52.
However I have spent 3 days trying to get it to work and I was just about to write to ask you what the problem was when - out of the blue- all of a sudden - it worked and I got the required result shown in fig 2-9.
However I do not know how - or more importantly where the session is being recorded. I believe I have a problem as I am not able to change the session.save_path variable in the php.ini file (which I have saved in the C:\windows directory) I have read somewhere that I might also have to save it in the C:\windows\system32 directory ??) but I have not done/tried that yet!!!!
When I was having difficulty getting the exercise to work I believed the problem was because I could not define the path in the session.save_path variable.
I tried numerous times to set up various directories next to the session.save_path variable in the php.ini file - but no matter what directory I specified ( and which I duly shared) it was never recorded in the php.ini file when I ran the following test programme:
<?
phpinfo ();
?>
It always showed âno value setâ as shown in the table below!
The path setting is currently set to â/tmpâ but I have no such folder on my C: drive!
Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 On On
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 100 100
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path no value no value
session.serialize_handler Php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid Off Off
Could you please explain why the exercise appears to be working - when there does not appear to be a folder â/tmpâ set up for session data to be recorded and the variable is showing âno valueâ against it?
Also how do I go about setting the session.save_path to a directory of my choice?
Many Thanks.
|
|

February 4th, 2005, 07:49 AM
|
|
Registered User
|
|
Join Date: Feb 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
My guess is that you are not editing the true php.ini file. When you run phpinfo() it will tell you the path to the ini file. Make sure this is the path you are using.
By default, php looks in the windows root directory for php.ini. This behavior can be changed (over-ridden) by registry entries and environmental path variables. It is also worth noting that php will run just fine if it can't find the php.ini file, it simply uses default values.
You've probably figured this out already but maybe this will help someone else.
Charlie
http://www.lupicas.com
|
|

February 27th, 2005, 06:00 AM
|
|
Registered User
|
|
Join Date: Feb 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I have the same problem. I edit the correct php.ini, under windows directory. The temp path is correct and session files are created (no error for cannot open/tmp etc) but unfortunately the session files are empty and contain no data. the variables I assign to session are not written to the file and therefore are not read by the moviesite.php . What is the problem?
|
|

March 9th, 2005, 03:12 AM
|
|
Registered User
|
|
Join Date: Mar 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,
Please try the following.
In Apache2\conf (or your directory)edit httpd.conf file looking for AllowOverride, the default of this is none, change it to All.
The default is 'very restircitive", I am not sure of the security implications, perhaps someone more with a few more smarts can answer...anyway this is the full section that comes with Apache
#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
Hope it helps...
|
|
 |