Call to undefined function cli_set_process_title()
What happened?
Running frankenphp php-cli artisan tinker in Laravel framework prints the following error:
Error Call to undefined function cli_set_process_title()
Build Type
Official static build
Worker Mode
Yes
Operating System
GNU/Linux
CPU Architecture
x86_64
Relevant log output
No response
This function is available only in CLI mode.
It is referring to the PHP official cli-sapi, which FrankenPHP (apparently) does not fully implement, and I'm not sure that it should, IMHO, since it does many slightly interesting things, such as setting different constants for i/o streams, how the working directory is applied, etc.
Laravel probably shouldn't blindly call a function only available in a specific SAPI without checking that it exists first, but FrankenPHP also probably shouldn't impersonate the official CLI SAPI.
@dunglas, how do you feel one way or the other?
Copy/pasting this function in FrankenPHP should do the trick.
what do you mean by copy/pasting?
Copy/pasting the C implementation of this function coming from the official PHP CLI SAPI.
So is there we can do in the userland? or is it done on the library side?
This should be done in frankenphp.c in this repo.
I'm concentrating on hunting down the remaining bugs, but then I'll work on this if no one else does it first!