Warning: Unknown: Failed to write session data using user-defined save handler. (session.save_path: D:\Software\phpstudy_pro\Extensions\tmp\tmp) in Unknown on line 0
Reasons:
1. the path of session.save_path is not correct
2. session.save_path's file permissions are not correct
3. and other reasons for the error, (but mine is not the problem) this problem sent me a day of time
My mistake:
The session that occurs when using this method_set_save_handler(‘open’,‘close’,‘read’,‘write’,‘destory’,‘gc’);
reason
1. the read callback function must return the value of the string, if not, other errors will be reported
2. write callback function must return true, if false will return the above error
3. write in the insert statement of the variable value must be added to the single quotes, otherwise it can not be inserted into the database
4. all but the read callback function must return a bool value, write must return true to insert into the database, and the others I think should also return true (not tested here)
Encounter this wrong idea
1. Check the configuration file for errors first
2. then check for errors in the return value
3. then check the sql statement for errors
4. debug with echo or var_dump at each step
If you solve the big guys’ problems, please give me a favor.
Read More:
- Error during session start; please check your PHP and/or webserver log file and configure your PHP
- [Solved] PHP Error: Warning: file_get_contents(): Failed to enable crypto
- [Solved] ‘node’ command failed to start the project, with an error: “unknown database’ mydb ‘”
- composer Failed to decode response: zlib_decode(): data error
- [PHP] Array to string conversion error when sending data in post
- composer Error while processing content unencoding: Unknown failure within decompression softwar
- [Solved] tp6.0 open_basedir Error: Warning: require(): open_basedir restriction in effect.
- [Solved] yii error: Setting unknown property: yii\console\Request: :cookieValidationKey
- PHP: How to get the total number of data in the MySQL table (total number of rows)
- [PHP] php8 jit does not support 32-bit systems WARNING: JIT not supported by host architecture
- php Error: mail() Failed to connect to mailserver at “localhost” port 25
- PHP file download, download failed, nginx open() nginx / fastcgi_ temp/2/10/0000000102“ failed (13: Permission denied)
- [Solved] PHPMailer Error: SMTP ERROR: Failed to connect to server: (0)
- [Solved] PHPMailer Failed to Send Email: SMTP Error: Could not connect to SMTP host.
- php_network_getaddresses: getaddrinfo failed (How to Fix)
- [Solved] WordPress Upgrade PHP 5.6 to 7.x Fatal error: Uncaught Error: Call to undefined function mysql_connect()
- How to solve Magento 500 internal server errors
- [Solved] Laravel Upload Files Verificate Error: The file failed to upload.
- [Solved] getObject: FAILED RequestCoreException: cURL resource: Resource id #78; cURL error: SSL certificate
- PHP use __Sleep() and __wakeup() method serializes the object