I'm moving from a local environment that was working just fine to a shared hosting platform. Upon transferring all of my files, my site stopped work and I've traced the problem to the Session Start() command in my bootstrap file.
Here is the relevant code:
Bootstrap file:
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/functions.php';
require_once __DIR__ . '/connection.php';
$dotenv = new Dotenv\Dotenv(__DIR__);
$dotenv->load();
$session = new Symfony\Component\HttpFoundation\Session\Session();
$session->start();
app/config/config.yml:
session:
handler_id: session.handler.native_file
save_path: "%kernel.root_dir%/../var/sessions/%kernel.environment%"
Here is the error message I'm getting:
Warning: SessionHandler::read(): open(/var/php_sessions/sess_b03f80ce089ee5aaa887a02b006e76b0, O_RDWR) failed: No such file or directory (2) in /hermes/bosnaweb03b/b700/ipg.briangwaltney/YSC-Main/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php on line 61 Warning: SessionHandler::write(): open(/var/php_sessions/sess_b03f80ce089ee5aaa887a02b006e76b0, O_RDWR) failed: No such file or directory (2) in /hermes/bosnaweb03b/b700/ipg.briangwaltney/YSC-Main/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php on line 69
I have set the permissions to writable on all the folders that might apply.
One thing I've noticed is when I adjust the config.yml
file, the error never changes. I've even tried using PDO Session Storage and still get the exact same error.
What am I doing wrong?
Thank you!