0

I have this problem for days now... I just do a fresh install on syfmony but after i create a bundle from symfony console i get this error from the webpage...

ContextErrorException: Warning: is_dir(): open_basedir restriction in effect. 
File(/srv/www/backend.tacon.eu/web) is not within the allowed path(s): (/var/www/clients/client1/web5/web:/var/www/clients/client1/web5/private:/var/www/clients/client1/web5/tmp:/var/www/backend.tacon.eu/web:/srv/www/backend.tacon.eu/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin) in /var/www/clients/client1/web5/web/back/vendor/symfony/symfony/src/Symfony/Component/Process/ExecutableFinder.php line 59

I don't know why is this happening. This is not my first symfony project and this never happens. Also on the same server i have various symfony projects.

Thanks in advance

Weinz
  • 396
  • 1
  • 5
  • 23

3 Answers3

2

I had the same problem after refresh install symfony using composer. I have solved this issue by editing php configuration file (php.ini).

Set the open_basedir option to null.

More about open_basedir

1

From ISPConfig: WebSites-> Your Site -> Options -> PHP open_basedir -> Add :/srv/www/backend.tacon.eu/web at the end of line

0

if you face this error on live server then you can solve this problem like this-

<?php
require_once __DIR__.'/../app/bootstrap.php.cache';
require_once __DIR__.'/../app/AppKernel.php';

use Symfony\Component\HttpFoundation\Request;

$kernel = new AppKernel('prod', true);
$kernel->loadClassCache();
// wrap the default AppKernel with the AppCache one

$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);

in line $kernel = new AppKernel('prod', true); you may change it "prod" or "dev" and it's value like true or false;

Md Mehedi Hasan
  • 1,733
  • 1
  • 21
  • 34