Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP 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
 
Old April 19th, 2004, 04:41 PM
Registered User
 
Join Date: Apr 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default session error - php.ini file

i am reciving the same error as qouted in some other posts !!!

Warning: session_register(): open(/tmp\sess_da92d09d5a6a9b5e6511dc88b437c183, O_RDWR) failed: No such file or directory (2) in C:\WEB\apartments-direct\site\dev\test.php on line 5

so - change "session.save_path = tmp" > "session.save_path = C:\PHP\sessiondata"

i have done this!!! saved the file php.ini in c:/winnt/
i have stoped and started iis, restarted my pc, stoped and started iis and restarted my pc...

but it has failed to register the changes i made to php.ini !!!!!

even if i delete the file c:/winnt/php.ini - it still runs the same error( i stoped and started iis). it looks like it is not recognising c:/winnt/php.ini

 
Old April 19th, 2004, 06:10 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Did you apply the proper write permissions to the directory?
http://p2p.wrox.com/topic.asp?TOPIC_ID=11962

Did you verify that the directory at C:\PHP\sessiondata exists?

hth,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
 
Old April 19th, 2004, 07:07 PM
Registered User
 
Join Date: Apr 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yeah the folder is "shared" - the funny thing is if i delete the php.inifile from my system it still runs with the same error as above ????

 
Old April 19th, 2004, 07:26 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Well, if you delete the php.ini file PHP is just going to fallback on all the default values that you saw in the file.

So let's troubleshoot step by step.

Make sure that php.ini has the right value then run a phpinfo() script. Look for the session.save_path value.

<?php
    phpinfo();
?>

This will spit out a detailed table of configuration settings.

If session.save_path still has a value of /tmp then the configuration change did not take effect and the problem is with your PHP install. If it does then there is a problem with the directory.

We can also rule in or out the php.ini file itself by doing an ini_set() on the configuration in the script itself. Include the following before the call to session_start().

<?php
    session_save_path("C:\PHP\sessiondata");

    session_start();
?>

If this works then that rules the directory out and places blame on the php.ini file itself.

If that does nothing -
Open up the directory in explorer, rerun the PHP script, if you see a file being created then there is possibly a problem with access privileges. If nothing happens then PHP doesn't have access to the directory at all. It needs read and write access to the directory. That's the 'Share this folder on the network' and 'Allow network users to change my files' settings in the sharing and security tab of the folder.

hth,
Rich


::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
 
Old April 20th, 2004, 05:49 AM
Registered User
 
Join Date: Apr 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i reinstalled php and made your changes to the .ini it works now. thanks mate

 
Old May 14th, 2004, 01:46 AM
Registered User
 
Join Date: May 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by bogins

Warning: session_register(): open(/tmp\sess_da92d09d5a6a9b5e6511dc88b437c183, O_RDWR) failed: ....

For future reference, you have your slashes wrong!

/tmp for linux, \\ for windows and in this case, /tmp\ for error :P

 
Old May 17th, 2004, 04:54 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Quote:
quote:Originally posted by branflakes
For future reference, you have your slashes wrong!

/tmp for linux, \\ for windows and in this case, /tmp\ for error :P
The slashes were reversed because the default value of session.save_path in php.ini is /tmp (suited for Linux users). Windows users have to specify the session.save_path directive explicity. His php.ini change from /tmp to C:\PHP\sessiondata wasn't getting picked up for some reason or another, hence the output of /tmp in the errors. At any rate he's already solved the problem.

Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
 
Old March 2nd, 2007, 07:23 AM
Registered User
 
Join Date: Dec 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have the exact same problem and have follows all your instructions but to no avail. Any more suggestions please?

chris
 
Old January 5th, 2008, 04:59 PM
Registered User
 
Join Date: Jan 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have a similar problem.

I have inherited a large PHP application running on a Linux server. I am trying to run the app locally under Windows XP/IIS. There are MANY instances of the following:

session_save_path('/usr/local/home/scoe/www/tmp');

I have this path on my Windows machine!

However, I get the following error:

PHP Warning: session_start() [function.session-start]: open(/usr/local/home/scoe/www/tmp\sess_c5d67f60259e49b432ac86f27b9d8a93, O_RDWR) failed: No such file or directory (2) in ...

I have tried changing the default session.save_path setting in php.ini, but I don't want to have to comment out or change all those existing references to the save path.

Any ideas?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Error / PHP.ini file socoolbrewster Beginning PHP 5 June 8th, 2006 04:18 AM
Ch 2; php.ini set up; /tmp file (where is it?) monster BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 February 21st, 2006 06:09 PM
PHP.ini and session.save_path variable ukbrit BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 3 March 9th, 2005 03:12 AM
php.ini allang Beginning PHP 1 November 20th, 2003 09:09 PM
php.ini include_path error problem paddy PHP How-To 1 July 21st, 2003 03:09 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.