Jump to content

PHP Warning: file_exists(): open_basedir restriction in effect. File(/views/templates/hook/eventViewItem.tpl)


dataleim

Recommended Posts

Hi, I have this error:

AH01071: Got error 'PHP message: PHP Warning: file_exists(): open_basedir restriction in effect. File(/views/templates/hook/eventViewItem.tpl) is not within the allowed path(s): (/var/www/vhosts/xxxx.com/:/tmp/) in /var/www/vhosts/xxxx.com/httpdocs/classes/module/Module.php on line 2509'

 

in the Module.php the line 2509 contains:                 !file_exists($template)

 

 

Complete code:

    /**
     * @param string $template
     * @param string|null $cache_id
     * @param string|null $compile_id
     *
     * @return Smarty_Internal_Template
     */
    protected function getCurrentSubTemplate($template, $cache_id = null, $compile_id = null)
    {
        if ($compile_id === null) {
            $compile_id = $this->getDefaultCompileId();
        }

        if (!isset($this->current_subtemplate[$template . '_' . $cache_id . '_' . $compile_id])) {
            if (false === strpos($template, 'module:') &&
                !file_exists(_PS_ROOT_DIR_ . '/' . $template) &&
2509->    !file_exists($template)
            ) {
                $template = $this->getTemplatePath($template);
            }

            $this->current_subtemplate[$template . '_' . $cache_id . '_' . $compile_id] = $this->context->smarty->createTemplate(
                $template,
                $cache_id,
                $compile_id,
                $this->smarty
            );
        }

        return $this->current_subtemplate[$template . '_' . $cache_id . '_' . $compile_id];
    }

 

 

Any ideas where can I search to fix this?

 

Thanks!

 

 

Link to comment
Share on other sites

  • 1 month later...

I have the same warning... but I can't disable open_basedir for a security reason. Can anyone help me please?

 

PHP Warning:  file_exists(): open_basedir restriction in effect. File(/views/templates/hook/style.tpl) is not within the allowed path(s): (/home/cmrledsh/:/opt/cpanel/ea-php81/root/usr:/usr/local/lib/php:/tmp:/etc/pki/tls/certs/ca-bundle.crt:/var/cpanel/php/sessions:/usr/local/bin/wp) in /home/cmrledsh/public_html/classes/module/Module.php on line 2287

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...