|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-08-24 07:03 UTC] yohgaki@php.net
-Status: Open
+Status: Wont fix
[2016-08-24 07:03 UTC] yohgaki@php.net
[2016-08-24 07:13 UTC] yohgaki@php.net
[2016-08-24 09:54 UTC] mark at sasoft dot co dot za
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 22:00:01 2025 UTC |
Description: ------------ It appears this bug exists regardless of any version of php or OS or web server. I have physically tested this to occur across: - Windows 7, Windows Server 2012 R2 - PHP Version 5.3, 5.4, 5.5, 5.6 and 7.0.10 (all binaries downloaded from php.net windows already compiled as NTS x86 and x64) - Apache 2.2 and IIS (7+8) My php.ini has been modified only for session.save_handler = user. All other settings left as default. What happens is that if I submit a form with file upload progress utilisation (ie. name as value from ini_get("session.upload_progress.name")) then the upload actually crashes the script and my error log file contains the contents : PHP Warning: Unknown: user session functions not defined in Unknown on line 0 PHP Fatal error: Unknown: Failed to initialize storage module: user (path: C:\WINDOWS\Temp) in Unknown on line 0 It appears that php is trying to default back to use save_hander=files and then fails. If i COMMENT OUT the PHP_SESSION_UPLOAD_PROGRESS line so that file upload progress is disabled, it works perfectly. It also works perfectly if i set the save_handler back to "files" in my php.ini. Naturally, even if it didnt generate a fatal error, the file session info would still be inaccessible to my database session if it succeeds in writing to the file. Test script: --------------- The html form looks like this : <iframe id="upload_iframe" name="upload_iframe" style="width: 1px; height: 1px; display: block;border:0px;"></iframe> <form id="myUploadForm" name="myUploadForm" target="upload_iframe" action="uploadFile.php" method="post" enctype="multipart/form-data"> <input type="hidden" name="UID" value="1"> <input type="hidden" value="myUploadForm" name="PHP_SESSION_UPLOAD_PROGRESS"> <input type="file" class="upload" name="file" id="file"> <input type="submit" class="cmi-button small white" value="Upload" onclick="fileUpload.startUploadMonitoring();"> </form> My session_set_save_handler override for _open looks like this : function _open() { if( ($this->dbc = mysqli_connect(DBSettings::HOSTNAME, DBSettings::USERNAME, DBSettings::PASSWORD)) !== false ) { $select_db = mysqli_select_db($this->dbc, DBSettings::DATABASE_SHARED_SERVICES); // $set_charset = mysqli_set_charset($this->dbc, DB_CHARSET); return( $select_db /*&& $set_charset*/ ); } else { trigger_error(mysqli_error($this->dbc), E_USER_ERROR); } return( false ); } (but i think the above handler override is irrelevant to this bug as even if i change the trigger_error to return true rather, it makes no difference as the error occurs BEFORE control is handed over to the USER script) Expected result: ---------------- it should firstly NOT crash PHP, and secondly it should use the php.ini setting for my database session handler. my error log file contains the contents : PHP Warning: Unknown: user session functions not defined in Unknown on line 0 PHP Fatal error: Unknown: Failed to initialize storage module: user (path: C:\WINDOWS\Temp) in Unknown on line 0 Actual result: -------------- my error log file contains the contents : PHP Warning: Unknown: user session functions not defined in Unknown on line 0 PHP Fatal error: Unknown: Failed to initialize storage module: user (path: C:\WINDOWS\Temp) in Unknown on line 0