Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

session_start() error: No such file or directory

Status
Not open for further replies.

Spork52

Programmer
Nov 20, 2007
134
US
My customer's host was bought out and the site was transferred to a new server. Since then, most of the time I get the following server error when session_start() is on the top of certain pages (this does not happen on all pages, and it does not happen every time on the affected pages):

Warning: session_start() [function.session-start]: open(/tmp/php-ses/sess_cf2faa9fcef60fba09ef68fd1c572683, O_RDWR) failed: No such file or directory (2) in /home/vg002web02/20/51/1015120/web/my_directory/my_page.php on line 2

The new server uses PHP 4.4.4-8+etch6.
I don't know what was installed on the old server.
My test server use PHP 5.2.5 and does not throw errors.

I noticed that the hosting company is using these settings:

session.use_only_cookies is OFF
session.use_trans_sid is ON
register_globals is ON

My limited understanding is that these are neither secure nor standard settings. Is that correct? Could those settings be a contributing cause to the above error or is something else going on? Any suggestions for the hosting company? (so far they don't seem to know what they are doing).
 
Those settings are not standard (especially register_globals), but fairly standard fir ISPs. Why? because ISPs rather have customers that can run any script, however unsafe, than a more secure system and customers running away because they cannot run a script they just downloaded somewgere.

But that has nothing to do with your problem. Call the hosting administrator. I think the user running PHP does not have sufficient rights on the location where the session files are stored (the system's temp directory). Also, the fact that errors are shown is a security error for a public server. They should be logged instead.

+++ Despite being wrong in every important aspect, that is a very good analogy +++
Hex (in Darwin's Watch)
 
Is there some way I can change the settings globally? I don't have access to the php.ini file.

I will be turning error reporting off once the problem is fixed.

The host "solved" the problem by adding this to the top of one of the affected pages:

Code:
session_save_path('/home/20/51/1015120/[URL unfurl="true"]www/tmp');[/URL]

which worked for that page.

Does that tell you anything more?
 
Only that he does not want to solve the real problem. It really is a configuration error.

The session storage path can be set in php.ini, but the user that the web server runs on must be able to use it. If nothing is set in php.ini, the system's temp directory is used, but the web server user must still be able to use it.

If that is how your host "solves" problems, I suggest changing hosts.


+++ Despite being wrong in every important aspect, that is a very good analogy +++
Hex (in Darwin's Watch)
 
Changing hosts is not an option at this point--my customer won't go for it . . . yet.

Why does the error and session_save_path() says the path is /tmp/php-ses/, but the host's fix uses /home/20/51/1015120/
Do php.ini settings apply to all the users on a shared server, or can they somehow be set independently for each user?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top