Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

maslauskast's avatar

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

Hi,

so recently I ran into quite a problem. Everything was working fine for almost half a year. A couple of days ago we started getting this error:

is_executable(): open_basedir restriction in effect. File(/usr/local/bin/php) is not within the allowed path(s): (/home/lbooster/:/tmp:/usr/share/pear)

This happens when trying to call artisan command inside an event listener:

public function handle(CampaignActivated $event)
    {
        Artisan::call('channels:queue', ['--campaign' => $event->campaign->id]);
    }

However, typing php artisan channels:queue --campaign=1 from console executes successfully without any errors.

We recently updated our application -- events and listeners were not changed in any way / none of the code related to campaigns changed... -- but we needed to update some dependencies with composer update.

What is more puzzling is that when I look for the loaded php configuration file, I get the same result from browser and from console - "/usr/local/lib/php72.ini", and looking into it, open_basedir setting is commented out...

Any ideas on what could have caused it? Server Hosting Provider swears they did not push any changes either.

I'm also wondering if there is any way to execute the script in the command without using artisan, e.g. newing up the class or something like that.

Thanks for any input!

EDIT: also, this command is scheduled to run once per day, which works no problem.

0 likes
0 replies

Please or to participate in this conversation.