![]() ![]() If you want to use 'memcacheD' extention not 'memcache' (there are In case the comment on the page is removed I am posting here: Make sure you change "localhost" to reflect your memcached servers location.įor more info see - Codeignier Session ManualĪlso have a look here: php memcacheD Sessions support The correct setting will look like this: $config = 'memcached' Make sure you set this to a valid path as documented in CI3's manual. The line that needed to be changed for me was this line: $config = NULL In Codeigniter's config file "/application/config/config.php" there is a section to to specify session options: $config = 'memcached' If that is good to go then we can proceed to check everything else. Obviously make sure memcacheD is installed: sudo apt-get update □Īnyway here is the solution at least for me. After I found the issue I realized how ridiculous it was and wonder how I didn't figure it out sooner. I ran into this issue using Codeigniter 3 and php 7.2. I decided to migrate my system and do some much-needed updating. ![]() So I just make sure that the user can access the database and it worked. INFO - 10:05:41 -> Database Driver Class InitializedĮRROR - 10:05:41 -> Severity: Warning -> mysqli::real_connect(): (HY000/1045): Access denied for user (using password: YES) /var/system/database/drivers/mysqli/mysqli_driver.php 202ĮRROR - 10:05:41 -> Unable to connect to the databaseĮRROR - 10:05:41 -> Severity: Warning -> mysqli::real_connect(): (HY000/1045): Access denied for user (using password: YES) var/system/database/drivers/mysqli/mysqli_driver.php 202ĮRROR - 10:05:41 -> Severity: Error -> session_start(): Failed to initialize storage module: user (path: ci_sessions) /var/system/libraries/Session/Session.php 140 Then refresh the page, and now I have in application/logs a file called log-#.php where # is a date. (For files probably it doesn't have the permission to write the cached files ) ![]() So since I used a database it means that it doesn't connect for some reason! I resolved the issue by looking at the config.php file $config = 'database' This is usually is due to the session not being able to connect to whichever driver it uses (file, database). Thanks for any help you can provide! I'm open to suggestions and willing to try anything at this point. I keep trying combinations and throwing things out in the wild and this issue happens every single time (sometimes it takes 12+ hours depending on the traffic to the website). I have experienced the issue on CodeIgniter & Symfony, and have experienced the issue regardless of the type of driver used in the framework (files, database, redis) or the session.save_handler set in php.ini (which, again, should be irrelevant here but just thought it should be mentioned). I have experienced the issue with PHP 7.0 RC5, RC6, & RC8 compiled on my own as well as the latest Ondřej Surý PPA on Ubuntu 15.10 Wily (7.0.0-2+~wily+1). but I was hoping to have things figured out by now. Obviously the PHP 7 machine will be pulled out of the load balancer rotation now. Restarting Apache does not correct the issue either - there are a number of issues at play here and I end up just rebooting the machine to avoid the downtime. and it's difficult to reproduce because everything seems to work fine even for hundreds of sessions (until it suddenly stops working). Why would this be happening? This is one of those issues that is difficult to describe until you have experienced it. The error message always has "user" for the session.save_handler so obviously that's not being pulled from php.ini. It's as if at some point, the sessions driver becomes a hybrid of the framework driver and whatever is set in php.ini. Also, calling "session_start()" outside of the framework works fine. The path here should never be hit unless a native "session_start()" is called in a php file outside of the framework. The drivers I am using do not use the values set in php.ini and regardless of whether I set the session.save_handler to files, redis, etc in php.ini and regardless of the path I set (Redis server if redis, fully-writable folder with files enabled) the errors occur. PHP Fatal error: session_start(): Failed to initialize storage At this point I have safely concluded that the type of session driver is irrelevant - seemingly at random, the application will crash and the logs (I've tried both Apache and php-fpm + nginx) fill up with the following: I initially experienced this issue while using the CodeIgniter database driver and assumed it was a CodeIgniter issue but have since experienced it on multiple sessions drivers and multiple frameworks. A bug exists when using various PHP framework session drivers with PHP 7.0. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |