Open_basedir restriction in effect

Hello,
I’m having troubles getting sitecake to work.
I made the site locally (xampp) installed sitecake and everything worked well, but on the webserver (extracted sitecake with akeeba) I get a bunch of errors:

Warning: is_dir(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/www/web310/html/:/var/www/web310/phptmp/:/var/www/web310/files/:/var/www/web310/atd/:/usr/share/php/:/opt/php/) in file [SITE]/sitecake/2.3.2/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php on line (#51) Warning: mkdir(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/www/web310/html/:/var/www/web310/phptmp/:/var/www/web310/files/:/var/www/web310/atd/:/usr/share/php/:/opt/php/) in file [SITE]/sitecake/2.3.2/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php on line (#52) Warning: ini_set(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/www/web310/html/:/var/www/web310/phptmp/:/var/www/web310/files/:/var/www/web310/atd/:/usr/share/php/:/opt/php/) in file [SITE]/sitecake/2.3.2/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php on line (#55) RuntimeException: Failed to start the session because headers have already been sent by "/var/www/web310/html/auris/kunden/groovedigger/sitecake/2.3.2/src/Sitecake/Error/ErrorHandler.php" at line 238. in file [SITE]/sitecake/2.3.2/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php on line (#144)

Tested it on another server (but the same hoster) got the same errors (different paths ofc).

What’s wrong here? :slight_smile:

Hi Dom,
as I can ses from log entries, problem is that php user doesn’t have permission to session path stored in php settings. Configuration regarding session can be changed in sitecake/2.3.2/config/config.php file.
You can use some other supported session handler and set it in $app[‘session.save_handler’].
Also, you could leave files session handler and set save_path option inside $app[‘session.options’] to some dir that is readable/writable by php user.

Thanks for your quick response.
Unfortunately I’m not too familiar with php since I just started learning it.
I don’t really know what to do.
What I did up until this point was:

  • checked php info for supported session handler, which is ‘files’ and I suppose is already set on line 23 of the config.php
    (see: http://auris-media.de/kunden/groovedigger/info.php)

  • I can’t find the option save_path inside $app['session.options'] only commented out in $app['session.save_handler']. So I thought I maybe have to put it in there manually and wrote the following:
    $app['session.options'] = [ 'save_path' => ['/var/www/web310/html/auris/kunden/groovedigger/test'] ];
    which, unsurprisingly, didn’t work.

I’m kinda lost here, what do I have to do, to get it to work?

try it with
$app[‘session.options’] = [
‘save_path’ => ‘/var/www/web310/html/auris/kunden/groovedigger/test’
];

That did the trick. Thank you!

@Dom Also You Should Disable your PHPinfo page if possible it is a potential security risk into your server