aRasH
aRasH

Reputation: 144

Symfony2 throws ContextErrorException after uploading the application to shared host

I have so much problems with deploying Symfony2 project to server, with searching and help of some links like Steps to move Symfony 2 project to hosting I finally did something! the problem is when I go to mydomain.com/web/app.php it shows blank page! and when I go to mydomain.com/web/app_dev.php it throws this exception:

ContextErrorException: Warning: is_file(): open_basedir restriction in effect. File(/var/www/Symfony/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventSubscriberInterface.php) is not within the allowed path(s): (/var/www/vhosts/mydomain.com/httpdocs/:/tmp/) in /var/www/vhosts/mydomain.com/httpdocs/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php line 80

The project works completely right on my local machine. Please help me with some advice, thanks.

Upvotes: 4

Views: 3896

Answers (2)

wathmal
wathmal

Reputation: 371

try clearing the cache, in the shared host delete everything inside the

app/cache

folder.

Upvotes: 1

TimoStaudinger
TimoStaudinger

Reputation: 42460

Check your open_basedir setting in your PHP configuration. Turning it off should resolve your issue.

Limit the files that can be accessed by PHP to the specified directory-tree, including the file itself. This directive is NOT affected by whether Safe Mode is turned On or Off.

When a script tries to access the filesystem, for example using include, or fopen(), the location of the file is checked. When the file is outside the specified directory-tree, PHP will refuse to access it. All symbolic links are resolved, so it's not possible to avoid this restriction with a symlink. If the file doesn't exist then the symlink couldn't be resolved and the filename is compared to (a resolved) open_basedir .

Upvotes: 2

Related Questions