I have been using memcached and I upgraded from PHP 5.4 to 5.6 and now it is failing to connect and store.
I have:
ini_set('session.save_handler', 'memcached');
ini_set('session.save_path', 'serverAddress:11211');
session_start();
I have also tried tcp:// before the server address, but no luck there.
In the error log, I am getting the following errors:
PHP Warning: session_start(): Write of lock failed
PHP Warning: session_start(): Unable to clear session lock record
PHP Warning: Unknown: Failed to write session data (memcached).
Please verify that the current setting of session.save_path is
correct
I guess something changed in the versions of PHP. Any help is appreciated, thanks!
Note: I am using Amazon Elastic Beanstalk for the web server and ElastiCache for the memcached
What I Have Tried
Used a config file with:
files:
"/etc/php.d/setup.ini":
mode: "000644"
owner: root
group: root
source: https://s3.amazonaws.com/path/to/file.ini
Inside of the ini file is:
[php]
session.save_handler = memcached
session.save_path = 'memcached.server.path.cache.amazonaws.com:11211'
I have tried using session_write_close()
I have tried using tcp:// before the server path
I have also tried using memcache instead of memcached as the
handler.
Related
when I try to run a especifical project on my computer, symfony show me this error:
Warning: SessionHandler::read(): open(/opt/alt/php74/var/lib/php/session\sess_rt7p5374uhjagiperqv83aej38, O_RDWR) failed: No such file or directory (2)
I'm use symfony 5.4 and PHP 8
I found this line session.save_path = "/opt/alt/php74/var/lib/php/session"
in .user.ini file and I changed it and now it's working
There is nothing wrong with Symfony's side. You can set proper path at session.save_path in your php.ini
session.save_path = "/path/to/your/folder"
The folder you use should be under your domain/account but not accessible through a Web browser. It also needs to have world-writable permissions on it based on user/role.
I am trying to deploy Codeigniter application in PCF. CF Push was success but i got the below error.
Type: Error
Message: Call to undefined function mysqli_init()
Filename: /home/vcap/app/htdocs/system/database/drivers/mysqli/mysqli_driver.php
Line Number: 135
Backtrace:
File: /home/vcap/app/htdocs/application/controllers/Dashboard.php
Line: 8
Function: __construct
File: /home/vcap/app/htdocs/index.php
Line: 315
Function: require_once
Does anyone how to deploy a php application with MySQLi driver enabled?
The extension isn't loaded. By default, the PHP Buildpack doesn't load any extensions.
The Cloud Foundry PHP Buildpack will ensure that extensions you require are loaded but you need to tell it to load them. There are two options for telling the buildpack which extensions to load:
Composer. If you require your PHP extensions, the buildpack will see this and automatically enable them. Ex: "require": "ext-mysqli".
Buildpack config file. Create .bp-config/php/php.ini.d/FILE-NAME.ini, where FILE-NAME is anything you want, I typically just call it extensions.ini. This file is read by PHP, so you can add any valid php.ini config, but for our purposes here you'd add extension=mysqli.so (or whatever extensions you want to load).
After making the changes from 1 or 2, just cf push your app again. The buildpack will run and it will enable the extensions you requested.
Error during session start; please check your PHP and/or webserver log file and configure your PHP installation properly. Also ensure that cookies are enabled in your browser.
session_start(): open(SESSION_FILE, O_RDWR) failed: Permission denied (13)
session_start(): Failed to read session data: files (path: /opt/lampp/temp/)
Things tried:
Changing file permissions and ownership.
Removing cookies from browser
Different browser
Things to note:
using ubuntu 18
mssql installed
uninstalled mysql previously and reinstalled again
mysql save installation also done
I was getting this error upon starting phpmyadmin on macOS High Sierra:
session_start(): open(SESSION_FILE, O_RDWR) failed: Permission denied (13)
Later I found out that the session.save_path was set to "/Applications/XAMPP/xamppfiles/temp" but the phpinfo() displayed:
session.save_path no value no value
I tested it by changing the path to another directory but it did not work and I am still getting the same 'no value'.
As a result I am unable to use session functions in any project.
You cat set session save path before running session start function, in you php application, for example:
ini_set('session.save_path','/var/tmp/');
OR
session_save_path('/var/tmp/');
OR in php.ini file:
session.save_path = "/var/tmp/"
When I migrated magento store and run it locally this happens.
Failed to initialize storage module: user (path: C:\wamp\www\magento\var\session) in C:\wamp\www\magento\app\code\core\Mage\Core\Model\Session\Abstract\Varien.php on line 115
This is line 115: session_start();
Help please.
For future reference, core_session table is missing in the database.
Look into your php.ini and make sure that the save_path isn't commented or missing:
session.save_path = "C:\wamp\tmp"
Create the folder C:\wamp\tmp first, change php.ini, then restart wamp.