frankenphp icon indicating copy to clipboard operation
frankenphp copied to clipboard

Call to undefined function cli_set_process_title()

Open smortexa opened this issue 1 year ago • 7 comments

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

smortexa avatar Feb 20 '24 09:02 smortexa

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?

withinboredom avatar Feb 20 '24 13:02 withinboredom

Copy/pasting this function in FrankenPHP should do the trick.

dunglas avatar Feb 20 '24 22:02 dunglas

what do you mean by copy/pasting?

sawirricardo avatar Mar 14 '24 15:03 sawirricardo

Copy/pasting the C implementation of this function coming from the official PHP CLI SAPI.

dunglas avatar Mar 14 '24 17:03 dunglas

So is there we can do in the userland? or is it done on the library side?

sawirricardo avatar Mar 15 '24 00:03 sawirricardo

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!

dunglas avatar Mar 15 '24 07:03 dunglas