Loading phar as a library



Error Message

on one of my pages I tried to add a require_once like this:


require_once 'phar://'.dirname(__FILE__).'/<phar_name>/vendor/autoload.php';

only to have these warnings:

Warning: require_once(): open_basedir restriction in effect. File(/home/vol15_4/epizy.com) is not within the allowed path(s): (/php_sessions:/tmp:/var/www/errors:/usr/share/pear:/home/vol15_4/epizy.com/epiz_33609212/htdocs) in /home/vol15_4/epizy.com/epiz_33609212/htdocs/login.php on line 22

Warning: require_once(phar:///home/vol15_4/epizy.com/epiz_33609212/htdocs/<phar_name>/vendor/autoload.php): failed to open stream: phar error: invalid url or non-existent phar "phar:///home/vol15_4/epizy.com/epiz_33609212/htdocs/<phar_name>/vendor/autoload.php" in /home/vol15_4/epizy.com/epiz_33609212/htdocs/login.php on line 22

Fatal error: require_once(): Failed opening required 'phar:///home/vol15_4/epizy.com/epiz_33609212/htdocs/<phar_name>/vendor/autoload.php' (include_path='/home/vol15_4/epizy.com/epiz_33609212/htdocs') in /home/vol15_4/epizy.com/epiz_33609212/htdocs/login.php on line 22

This is the first time I’m using phar so I have no idea what’s wrong or how o fix this
Any help will be appreciated


this is just a template !
where you have to write the values yourself

you cannot use < > because they are special characters ( invalid url)

Hi Oxy,
Thanks but I was the one who replaced the filename when I posted the question as it is irrelevant to the error.

Never mind! for some reason I cannot upload my phar. it is uploaded find through FTP or through the file manager but it does not appear afterwards (don’t know why though… I’ll open a new thread about it)

That’s why it cannot find the phar file anywhere

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