Server Error 500 on Symfony 5 WebApp

Username (e.g. epiz_XXX) or Website URL

http://experiments-101.epizy.com/

Error Message

Warning : is_dir(): open_basedir restriction in effect. File(/home/vol13_6/epizy.com/epiz_26080844/htdocs\vendor\symfony\framework-bundle/Resources/views) is not within the allowed path(s): (/php_sessions:/tmp:/var/www/errors:/usr/share/pear:/home/vol13_6/epizy.com/epiz_26080844/htdocs) in /home/vol13_6/epizy.com/epiz_26080844/htdocs/vendor/twig/twig/src/Loader/FilesystemLoader.php on line 91

Other Information

Hello, I’m relatively new in PHP frameworks and wanted to test out my webapp on a hosting provider, I uploaded the whole site and required files but the open_basedir() restriction seems to block some components required by Symfony to work, I’d really appreciate if you guys assisted me getting that project going here.

You need to correct backslashes with slashes, because Linux servers only support slashes as directory separators.

3 Likes

I replaced the backslashes with slashes, it did remove the php warning from the page, but I still have that Internal Server error 500

Try to use DIRECTORY_SEPARATOR instead of / or \

Can you please share the new error message? Because if it’s exactly the same, you didn’t update your directory separators correctly, and you need to fix those first.

1 Like

I finally got a fix for it,

I removed a error checker on line 91
if (!is_dir($checkPath)) {
throw new LoaderError(sprintf(‘The “%s” directory does not exist (“%s”).’, $path, $checkPath));
}

2 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.