Open jurrid opened 1 week ago
@dunglas do you might know if there's anything obvious we're missing here? 🤔
The ScheduleRunCommand
calls Application::phpBinary()
which then uses Symfony\Component\Process\PhpExecutableFinder
to find PHP's binary.
@jurrid, can you test, like in a simple script, if Symfony\Component\Process\PhpExecutableFinder
can find PHP's binary when running from a FrakenPHP installation?
I don't have any FrakenPHP projects in hand, and I am out-of-office, thus away from my work machine.
The code used by Application::phpBinary()
seems pretty straightforward:
(new PhpExecutableFinder)->find(false);
If it can't, maybe it is best to report it to Symfony.
As a quick workaround, storing this script in your PATH
should fix the issue.
A better long term solution would indeed be to add support for FrankenPHP in Symfony\Component\Process\PhpExecuyableFinder
.
I ran the test on the VPS, and here’s the output:
/tmp/frankenphp_4903f3929bf859903322f1f81c789b25/artisan
The binary in the linked GitHub repo has been updated for anyone who wants to test this output as well.
/root/frankenphp php-cli artisan app:output-binary
As suggested by @dunglas , one option is to follow his PATH
approach. Alternatively, if your scheduling isn’t too complex, like mine, you can manually add the commands to the crontab without using Laravel’s schedule:run
.
For now, I think the Laravel issue can be closed. I will report this issue on the Symfony repo.
Laravel Version
11.22
PHP Version
8.3
Database Driver & Version
Sqlite
Description
I’m using a FrankenPHP binary and trying to add the
schedule:run
command to the crontab. However, I’m encountering an error where PHP cannot be found, which is expected because the binary is running on a clean DigitalOcean (DO) VPS with no PHP. I suspect the issue lies in the Schedule::class’s command function, which only returns the Artisan path as a string.I’m unsure whether this is a Laravel, Symfony, or FrankenPHP issue, but I’m starting by reporting it here in the Laravel framework repo.
Steps To Reproduce
Create a clean Linux VPS (I tested on the smallest DigitalOcean droplet: Ubuntu 24.04 x64, 512 MB Memory, 10 GB Disk).
Run the following command to create the necessary Laravel storage directories:
Upload the FrankenPHP binary to the /root folder on the VPS and make the file executable:
tar -xvf frankenphp.tar.gz;
chmod +x /root/frankenphp;
Attempt to run the command:
Observe the failure.
Additional Information:
/root/storage/logs/cronjob.log
file.