OpenCart Fix: open_basedir restriction in effect.

If you're receiving following error while accessing your Opencart web site:

open_basedir restriction in effect. 
File(/) is not within the allowed path(s):

Please follow the below steps to fix this issue for Opencart installation:

  1. After installation, open data directory. In your case it is /home/username/ocartdata

  2. Open file from file manager in edit mode: /ocartdata/storage/vendor/twig/twig/src/Loader/FilesystemLoader.php

  3. On line number 90 replace following below code:

$checkPath = $this->isAbsolutePath($path) ? $path : $this->rootPath.$path;

with

$checkPath = $this->rootPath.$path;

Save the file and check the front-end, it should be working without any issue.

  • 24 Users Found This Useful
Was this answer helpful?

Powered by WHMCompleteSolution