php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13182 session_start() can't create a _new_ session control file.
Submitted: 2001-09-06 14:16 UTC Modified: 2002-04-07 00:00 UTC
Votes:15
Avg. Score:4.4 ± 1.1
Reproduced:13 of 13 (100.0%)
Same Version:2 (15.4%)
Same OS:3 (23.1%)
From: d99alu at efd dot lth dot se Assigned: yohgaki (profile)
Status: No Feedback Package: Session related
PHP Version: 4.1.1 OS: Solaris 7
Private report: No CVE-ID: None
 [2001-09-06 14:16 UTC] d99alu at efd dot lth dot se
We installed php 4.0.6 in a Roxen 2.1.625 web server on Solaris 7. Now we have a problem with temporary session files. The session_start() command will abort with the following error message:

Warning: open(/tmp/sess_e8771af1171a6cbdf51eebdba5199d25, O_RDWR) failed: m (0) in [path/file.php] on line 78

Warning: open(/tmp/sess_e8771af1171a6cbdf51eebdba5199d25, O_RDWR) failed: m (0) in Unknown on line 0

Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0

The thing is that session.save_path is correct. It points to /tmp, where the web server and php has write permissions. The session controller can read and write existing files. The problem occurs only when session_start() has to create a _new_ session control file. 

If we use fopen(), we can read and write files in /tmp. If we create a file with the name of the supposed session control file (sess_..., the name stated in the error message from session_start()) with fopen() and then reload the page, session_start() will execute correctly, using the file we just created for it. Then php will access the file correctly, writing and reading session variables just as it is supposed to.

So, again, the problem occurs only when session_start() has to create a _new_ session control file. Shouldn't a file be created automatically if it doesn't exist?

The only strange thing with the installation of PHP on Roxen was that no binary file was created. We can't find the stand-alone program to execute php files from the shell. This happened even though no error message was given at the time of installation.

The roxen installation was made as the config script suggested.

Do you have a clue why this problem occurs?

What our research toold us is:
"If the 'open' is a system call, then this is the expected behavior.
You need to provide a O_CREAT (or O_APPEND, don't know which) that will automatically create the file if it doesn't exist.  Just providing O_RDWR/RDONLY will not create the file, and will return an error if the file doesn't exist.  
This is the correct behavior for a POSIX open system call."


Best regards,

Andreas Lundgren
mailto:d99alu@efd.lth.se
please reply!

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-19 22:24 UTC] yohgaki@php.net
Please test with 4.1.0 and latest CVS snapshot.
CVS snapshot source can be found 
http://snaps.php.net/
(No windows binary)

If you don't have problem with latest CVS snapshot,
you can close your bug report by yourself.

Please report the result. When you update your bug
report, do not forget updating PHP version also.

Thank you
-- 
Yasuo


 [2002-01-09 02:07 UTC] lobbin@php.net
No feedback. Closing.
 [2002-01-15 03:34 UTC] yohgaki@php.net
Got feedback from a user.
-- feedback from samcooley@yahoo.com --
Hello,

I was hoping you could re-open PHP-BUG #13182.  I have
completed a test in 4.1.1 and receive the same error. 
I have also attempted to compile a snapshot from CVS
but the build failed so I will have to tweak it and
get back to you on that.

As for this bug, I am attaching the error on top of a
phpinfo() page.  I originally tried it in 4.0.6 or
some older release.  The only configure params, as you
can see, are the Roxen location and the Sybase
location (for Sybase support).  

I have tested this application from 4.0.0 on in Apache
on Win2000, Solaris 7 and Solaris 8.  I have tested it
with 4.0.6 on Roxen with Solaris 7.  So the difference
here (and I have really tried to bring the configs as
close as possible) seems to be the Solaris 7 vs 8.  

I will try and gather more information but would
appreciate the bug being reopened as I feel it is
reproducible.

Regards,

Sam Cooley

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/



4.1.1 OUTPUT -----
---------------------------------------------------------------------

Warning: open(/opt/www/cgi-bin/blahapp/conf/sess_9265832f97f81fa3ad1ee1bcc7bd4de7, O_RDWR) failed: Error 0 (0) in /opt/www/cgi-bin/blahapp/php/blahapp_init.phtml on line 37
PHP Version 4.1.1 

System SunOS www.blah.com 5.8 Generic_108528-05 sun4u sparc SUNW,Ultra-80 
Build Date Jan 15 2002 
Configure Command  './configure' '--with-sybase=/opt/sybase/SQL/current' '--with-roxen=/opt/roxen/server' 
Server API Roxen 
Virtual Directory Support disabled 
Configuration File (php.ini) Path /usr/local/lib/php.ini 
ZEND_DEBUG disabled 
Thread Safety disabled 

 This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.1.1, Copyright (c) 1998-2001 Zend Technologies
 


--------------------------------------------------------------------------------

PHP 4.0 Credits

--------------------------------------------------------------------------------

Configuration
PHP Core 
Directive Local Value Master Value 
allow_call_time_pass_reference
 On On 
allow_url_fopen
 1 1 
always_populate_raw_post_data
 0 0 
arg_separator.input
 & & arg_separator.output
 & & asp_tags
 Off Off 
auto_append_file
 no value no value 
auto_prepend_file
 no value no value 
browscap
 no value no value 
default_charset
 no value no value 
default_mimetype
 text/html text/html 
define_syslog_variables
 Off Off 
disable_functions
 no value no value 
display_errors
 On On 
display_startup_errors
 Off Off 
doc_root
 no value no value 
enable_dl
 On On 
error_append_string
 no value no value 
error_log
 no value no value 
error_prepend_string
 no value no value 
error_reporting
 2039 2039 
expose_php
 On On 
extension_dir
 ./ ./ 
file_uploads
 1 1 
gpc_order
 GPC GPC 
highlight.bg
 #FFFFFF #FFFFFF 
highlight.comment
 #FF9900 #FF9900 
highlight.default
 #0000CC #0000CC 
highlight.html
 #000000 #000000 
highlight.keyword
 #006600 #006600 
highlight.string
 #CC0000 #CC0000 
html_errors
 On On 
ignore_user_abort
 Off Off 
implicit_flush
 Off Off 
include_path
 .:/usr/local/lib/php .:/usr/local/lib/php 
log_errors
 Off Off 
magic_quotes_gpc
 On On 
magic_quotes_runtime
 Off Off 
magic_quotes_sybase
 Off Off 
max_execution_time
 30 30 
open_basedir
 no value no value 
output_buffering
 no value no value 
output_handler
 no value no value 
post_max_size
 8M 8M 
precision
 14 14 
register_argc_argv
 On On 
register_globals
 Off Off 
safe_mode
 Off Off 
safe_mode_exec_dir
 no value no value 
safe_mode_gid
 Off Off 
safe_mode_include_dir
 no value no value 
sendmail_from
 me@localhost.com me@localhost.com sendmail_path
 /usr/lib/sendmail -t -i  /usr/lib/sendmail -t -i  
short_open_tag
 On On 
SMTP
 localhost localhost 
sql.safe_mode
 Off Off 
track_errors
 Off Off 
upload_max_filesize
 2M 2M 
upload_tmp_dir
 no value no value 
user_dir
 no value no value 
variables_order
 EGPCS EGPCS 
xmlrpc_error_number
 0 0 
xmlrpc_errors
 Off Off 
y2k_compliance
 Off Off 


xml
XML Support active 
XML Namespace Support active 
EXPAT Version 1.95.2 


sybase
Sybase Support enabled 
Allow Persistent Links Yes 
Persistent Links 0/unlimited 
Total Links 0/unlimited 
Application Name PHP 4.0 
Client API Version Sybase DB-Library/12.0/P/SPARC/Solaris 2.5.1/1/OPT/Sat Sep 25 21:02:07 1999 


standard
Regex Library Bundled library enabled 
Dynamic Library Support enabled 
Path to sendmail /usr/lib/sendmail -t -i  

Directive Local Value Master Value 
assert.active
 1 1 
assert.bail
 0 0 
assert.callback
 no value no value 
assert.quiet_eval
 0 0 
assert.warning
 1 1 
safe_mode_allowed_env_vars
 PHP_ PHP_ 
safe_mode_protected_env_vars
 LD_LIBRARY_PATH LD_LIBRARY_PATH 
session.use_trans_sid
 1 1 


session
Session Support enabled 

Directive Local Value Master Value 
session.auto_start
 Off Off 
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_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
 /opt/www/cgi-bin/blahapp/conf /opt/www/cgi-bin/blahapp/conf 
session.serialize_handler
 php php 
session.use_cookies
 On On 


posix
Revision $Revision: 1.33.2.1 $ 


pcre
PCRE (Perl Compatible Regular Expressions) Support enabled 
PCRE Library Version 3.4 22-Aug-2000 


mysql
MySQL Support enabled 
Active Persistent Links 0 
Active Links 0 
Client API version 3.23.39 
MYSQL_MODULE_TYPE builtin 
MYSQL_SOCKET /tmp/mysql.sock 
MYSQL_INCLUDE   
MYSQL_LIBS   

Directive Local Value Master Value 
mysql.allow_persistent
 On On 
mysql.default_host
 no value no value 
mysql.default_password
 no value no value 
mysql.default_port
 no value no value 
mysql.default_socket
 no value no value 
mysql.default_user
 no value no value 
mysql.max_links
 Unlimited Unlimited 
mysql.max_persistent
 Unlimited Unlimited 


Roxen
SAPI module version $Id: roxen.c,v 1.47.2.1 2001/10/12 11:56:37 ssb Exp $ 


Additional Modules


Environment
Variable Value 
CLASSPATH java/classes/servlet.jar:java/classes/roxen_servlet.jar:java/classes/roxen_module.jar:java/classes 
DISPLAY idonex:0 
HOME /export/home/demo 
JREHOME /usr/java1.2/jre 
LD_LIBRARY_PATH /opt/sybase/SQL/current/ASE-12_0/lib:/opt/sybase/SQL/current/OCS-12_0/lib:/opt/sybase/SQL/current/OCS-12_0/devlib:/usr/java1.2/jre/lib/sparc:/opt/sybase/SQL/current/lib 
LOGNAME demo 
MAIL /var/mail/demo 
PATH /usr/sbin:/usr/bin 
PS1 #  
PWD /etc/rc3.d 
SHELL /bin/csh 
SSH_CLIENT 193.45.251.45 1015 22 
SSH_TTY /dev/pts/2 
SYBASE /opt/sybase/SQL/current 
TERM xterm 
TZ MET 
USER demo 


PHP Variables
Variable Value 
PHP_SELF /php/blahapp.phtml 
_COOKIE["PHPSESSID"] 9265832f97f81fa3ad1ee1bcc7bd4de7  
_SERVER["argv"] Array
(
)

  
_SERVER["argc"] 0  
_ENV["CLASSPATH"] java/classes/servlet.jar:java/classes/roxen_servlet.jar:java/classes/roxen_module.jar:java/classes  
_ENV["DISPLAY"] idonex:0  
_ENV["HOME"] /export/home/demo  
_ENV["JREHOME"] /usr/java1.2/jre  
_ENV["LD_LIBRARY_PATH"] /opt/sybase/SQL/current/ASE-12_0/lib:/opt/sybase/SQL/current/OCS-12_0/lib:/opt/sybase/SQL/current/OCS-12_0/devlib:/usr/java1.2/jre/lib/sparc:/opt/sybase/SQL/current/lib  
_ENV["LOGNAME"] demo  
_ENV["MAIL"] /var/mail/demo  
_ENV["PATH"] /usr/sbin:/usr/bin  
_ENV["PS1"] #   
_ENV["PWD"] /etc/rc3.d  
_ENV["SHELL"] /bin/csh  
_ENV["SSH_CLIENT"] 193.45.251.45 1015 22  
_ENV["SSH_TTY"] /dev/pts/2  
_ENV["SYBASE"] /opt/sybase/SQL/current  
_ENV["TERM"] xterm  
_ENV["TZ"] MET  
_ENV["USER"] demo  


PHP License
This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE 

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 

If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net. 
 
4.latest-20020114 OUTPUT -----
---------------------------------------------------------------------


 [2002-01-15 03:37 UTC] yohgaki@php.net
Version update.
 [2002-01-15 04:20 UTC] d99alu at efd dot lth dot se
We sloved the problem in out system by saving the session data in the mySQL-databas. That is at least a way to avoid the problem.
best regards,
Andreas Lundgren
 [2002-02-03 19:48 UTC] yohgaki@php.net
This my be fixed by my patch.
(Session module was trying to open exlusively more than once)
 [2002-02-28 07:17 UTC] yohgaki@php.net
This bug has been fixed in CVS.


 [2002-02-28 19:37 UTC] yohgaki@php.net
I'm holding commit, it's not fixed yet
 [2002-03-06 02:45 UTC] yohgaki@php.net
Could you try snapshot now?

http://snaps.php.net/
 [2002-03-06 08:28 UTC] kage-chan at users dot sf dot net
Hello there.
I'm experiencing exactly the same problem as described above. The only difference is, I don't use Roxen as httpd, I use Apache (1.3.23). My PHP version is 4.1.2.
I hope it helped you a little ...

kage-chan
 [2002-04-07 00:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2002-04-17 21:35 UTC] mpaulaherrero at hotmail dot com
Hi,

We have the same problem. We are using php 4.1.2, Apache 1.3.23 and Solaris 7, and we can't open sessions files.

Who can help us?

Maria Paula Herrero
 [2003-07-07 03:37 UTC] svec at nostromo dot cz
We are experiencing this problem too,

We have sessions stored in files, one directory per virtual web server

Problem shows absolute randomly, i can say, that it shows in ~ 1 - 2 % of php - processed pages.

Our config:

server:
redhat 7.2, latest apache2.0.46, php 4.2.3, apache & php compiled (no rpms)

config:

apache2:

./configure --sysconfdir=/var/www/conf --enable-shared=max --enable-ssl --with-ssl=/usr/local --enable-headers --enable-deflate --enable-env --enable-negotiation --enable-expires --enable-dav --enable-dav-fs

php:

./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/var/www/conf --enable-inline-optimization 
--with-pear=/var/www/pear --with-mysql=/usr/local --with-interbase --enable-dbase --enable-magic-quotes --with-zlib --enable-track-vars --enable-ftp --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-freetype-dir=/usr/local --with-openssl=/usr/local/ssl --with-curl=/usr/local --enable-rule=EAPI

thanks
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Oct 30 22:01:28 2024 UTC