ErrorException is_file(): open_basedir restriction in effect

https://wellnesspharma.protechtion.in/

Hi!

Sir,

After transferring files page is not working. Getting error but this website is working locally through Wamp server without any error. Only getting error when trying to run after hosting it. Please help. Thank you.

Warning : is_file(): open_basedir restriction in effect. File(/home/vol16_1/epizy.com/epiz_29013619/wellnesspharma.protechtion.in/htdocs/app//Helpers/lang_helper.php/Config/Registrar.php) is not within the allowed path(s): (/php_sessions:/tmp:/var/www/errors:/usr/share/pear:/home/vol16_1/epizy.com/epiz_29013619/wellnesspharma.protechtion.in/htdocs) in /home/vol16_1/epizy.com/epiz_29013619/wellnesspharma.protechtion.in/htdocs/system/Autoloader/FileLocator.php on line 248

ErrorException

is_file(): open_basedir restriction in effect. File(/home/vol16_1/epizy.com/epiz_29013619/wellnesspharma.protechtion.in/htdocs/app//Helpers/lang_helper.php/Config/Events.php) is not within the allowed path(s): (/php_sessions:/tmp:/var/www/errors:/usr/share/pear:/home/vol16_1/epizy.com/epiz_29013619/wellnesspharma.protechtion.in/htdocs) search →

SYSTEMPATH/Autoloader/FileLocator.php at line 248

241         $path = $this->ensureExt($path, $ext);
242 
243         $foundPaths = [];
244         $appPaths   = [];
245 
246         foreach ($this->getNamespaces() as $namespace)
247         {
248             if (isset($namespace['path']) && is_file($namespace['path'] . $path))
249             {
250                 $fullPath = $namespace['path'] . $path;
251                 if ($prioritizeApp)
252                 {
253                     $foundPaths[] = $fullPath;
254                 }
255                 else
  1. {PHP internal code} — CodeIgniter\Debug\Exceptions->errorHandler ( arguments )
  2. SYSTEMPATH/Autoloader/FileLocator.php : 248 — is_file()
  3. SYSTEMPATH/Events/Events.php : 112 — CodeIgniter\Autoloader\FileLocator->search ( arguments )
105         $config = config('Modules');
106 
107         $files = [APPPATH . 'Config/Events.php'];
108 
109         if ($config->shouldDiscover('events'))
110         {
111             $locator = Services::locator();
112             $files   = $locator->search('Config/Events.php');
113         }
114 
115         static::$files = $files;
116 
117         foreach (static::$files as $file)
118         {
119             if (is_file($file))
  1. SYSTEMPATH/Events/Events.php : 179 — CodeIgniter\Events\Events::initialize ()
172      * @return boolean
173      */
174     public static function trigger($eventName, ...$arguments): bool
175     {
176         // Read in our Config/events file so that we have them all!
177         if (! static::$initialized)
178         {
179             static::initialize();
180         }
181 
182         $listeners = static::listeners($eventName);
183 
184         foreach ($listeners as $listener)
185         {
186             $start = microtime(true);
  1. SYSTEMPATH/CodeIgniter.php : 295 — CodeIgniter\Events\Events::trigger ( arguments )
288         $this->getRequestObject();
289         $this->getResponseObject();
290 
291         $this->forceSecureAccess();
292 
293         $this->spoofRequestMethod();
294 
295         Events::trigger('pre_system');
296 
297         // Check for a cached page. Execution will stop
298         // if the page has been cached.
299         $cacheConfig = new Cache();
300         $response    = $this->displayCache($cacheConfig);
301         if ($response instanceof ResponseInterface)
302         {
  1. FCPATH/index.php : 62 — CodeIgniter\CodeIgniter->run ()
55 $dirname = rtrim(dirname($_SERVER['PHP_SELF']), '/').'/';
56 $dirname = str_replace("/index.php","",$dirname);
57     if(isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] != 'off') $https = true;
58 $installerurl=$protocol.$_SERVER['HTTP_HOST'].$dirname;
59 header('Location: '.$installerurl.'install');
60 exit;
61 }
62 $app->run();
63 

Displayed at 12:42:18pm — PHP: 7.4.8 — CodeIgniter: 4.0.4

Your script cannot be used on free hosting as it is trying to open files outside of your website’s folder.

2 Likes

Is there any process to resolve it? Please share…

The simple answer: no.

1 Like

Upgrade to premium hosting???

That’s very strange. The open_basedir setting says /home/vol16_1/epizy.com/epiz_29013619/wellnesspharma.protechtion.in/htdocs is allowed, and the file you’re trying to load is within that path, so it should just work.

That said, there are some weird things in the file path app//Helpers/lang_helper.php/Config/Registrar.php. In it, I see:

  • There are two slashes between app and Helpers.
  • There seem to be two files in the path, a Helpers/lang_helper.php and a Config/Registrar.php. That seems incorrect.
2 Likes

Sir from where I can remove the slash. Please help. I am very new on it.

It is probably an error with the script you are using. Maybe try re-downloading it from its source?

I have deleted twice and uploaded fresh one. still getting same sir.

I don’t have a clue. My guess is that it’s an issue with the website software. It could be a bug in the code or a problem in your configuration of it. But I don’t know the script so I don’t know how to solve this and who should solve this.

Perhaps the developer of the script can clarify that?

2 Likes

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