Page 1 of 1

[SOLVED] Warning: open_basedir needs to allow access to /home/...

Posted: Sun Apr 13, 2025 3:37 pm
by maffe
Hello all,
I tried Opencart 4.1.0.3 installation on php 8.2.27 and i cannot get passed by pre-install screen:
Warning: open_basedir needs to allow access to /home/pathhoster/...
What shoud i do to fix this?

And when i try to install on php 8.3 i get Warning:
Warning: ZEND OPcache API is restricted by "restrict_api" configuration directive in /system/storage/vendor/twig/twig/scr/Cache/FilesystemCache.php

Re: Warning: open_basedir needs to allow access to /home/...

Posted: Sun Apr 13, 2025 6:51 pm
by ADD Creative
First issue is this one.
https://github.com/opencart/opencart/issues/14734

You will need to manually check or remove your open_basedir PHP setting and then remove the broken open_basedir check from install/controller/install/step_2.php.

The other issue is this one.
https://github.com/opencart/opencart/issues/11596

It looks like it won't be fixed, but there are some suggestions to work around it.

Re: Warning: open_basedir needs to allow access to /home/...

Posted: Sun Apr 13, 2025 9:49 pm
by maffe
I still don’t understand it... Could you explain this in a bit more detail?
P.S. I’m using the hosting provider mijn.host and I have DirectAdmin access there.
Do I need to contact them for this, or can I adjust it somewhere myself? I don’t see any setting related to ‘open_basedir’.

Pff, looks like no OpenCart 4.x for me just yet.

Re: Warning: open_basedir needs to allow access to /home/...

Posted: Sun Apr 13, 2025 9:57 pm
by by mona
No one here recommends OC4 for production sites - just for developers to test and assist in fixing the bugs
OC3.0.4.0 is stable, updated and supports php8
It is available on the official Opencart download page https://www.opencart.com/index.php?rout ... ad/history

Re: Warning: open_basedir needs to allow access to /home/...

Posted: Mon Apr 14, 2025 6:11 pm
by ADD Creative
As long as your open_basedir is set to one directory above where you are installing OpenCart, you just need to remove the following line.
https://github.com/opencart/opencart/bl ... 2.php#L175

Re: Warning: open_basedir needs to allow access to /home/...

Posted: Tue Apr 15, 2025 1:40 am
by maffe
How and where can i change the open_basedir setting?
Image

Re: Warning: open_basedir needs to allow access to /home/...

Posted: Tue Apr 15, 2025 4:14 pm
by ADD Creative
That setting should work as it includes a directory above the install directory. If you do need to change it you will have to ask your host.

Re: Warning: open_basedir needs to allow access to /home/...

Posted: Fri Apr 25, 2025 10:38 pm
by maffe
I’ve tried several things with my provider. I CANNOT get past this point.
What a crappy installation. Even the checkbox under Status says "passed." But it keeps showing this error:
Warning: open_basedir needs to allow access to /home/un119489/domains/<domain>.nl/
Please help

Re: Warning: open_basedir needs to allow access to /home/...

Posted: Fri Apr 25, 2025 11:08 pm
by khnaz35
Have you tried installing version 3.0.4.0?

Re: Warning: open_basedir needs to allow access to /home/...

Posted: Fri Apr 25, 2025 11:19 pm
by ADD Creative
maffe wrote:
Fri Apr 25, 2025 10:38 pm
I’ve tried several things with my provider. I CANNOT get past this point.
What a crappy installation. Even the checkbox under Status says "passed." But it keeps showing this error:
Warning: open_basedir needs to allow access to /home/un119489/domains/<domain>.nl/
Please help
Yes, 4.x seems to be very buggy which is why a lot recomend using 3.0.4.0.

Did you try removing the following line frominstall/controller/install/step_2.php?

Code: Select all

$json['error'] = sprintf($this->language->get('error_open_basedir'), $required);

Re: Warning: open_basedir needs to allow access to /home/...

Posted: Sat Apr 26, 2025 3:57 am
by maffe
Hello Creative,
I just removed the line you described. That works!
Thank you!

Re: Warning: open_basedir needs to allow access to /home/...

Posted: Sun May 04, 2025 3:26 pm
by iplocker
Did you try removing the following line frominstall/controller/install/step_2.php? wrote:

Code: Select all

$json['error'] = sprintf($this->language->get('error_open_basedir'), $required);
Did that and we pass the installation process BUT now we have
Warning: realpath(): open_basedir restriction in effect. File(/home/..../webapps) is not within the allowed path(s): (/home/..../webapps/.......:/var/lib/php/session:/tmp) in /home/..../webapps/....../admin/controller/common/security.php on line 58
at the top of the admin pages
If Opencart 4.x is difficult from the start what we should expect later ?
Thanks

Re: Warning: open_basedir needs to allow access to /home/...

Posted: Sun May 04, 2025 11:05 pm
by ADD Creative
iplocker wrote:
Sun May 04, 2025 3:26 pm
Did you try removing the following line frominstall/controller/install/step_2.php? wrote:

Code: Select all

$json['error'] = sprintf($this->language->get('error_open_basedir'), $required);
Did that and we pass the installation process BUT now we have
Warning: realpath(): open_basedir restriction in effect. File(/home/..../webapps) is not within the allowed path(s): (/home/..../webapps/.......:/var/lib/php/session:/tmp) in /home/..../webapps/....../admin/controller/common/security.php on line 58
at the top of the admin pages
If Opencart 4.x is difficult from the start what we should expect later ?
Thanks
You need to ask your host how to allow "/home/..../webapps" in the PHP open_basedir setting.