Skip to content

Call to undefined function cli_set_process_title() #587

Open

Description

@smortexa

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

Activity

  1. withinboredom commented on Feb 20, 2024

    @withinboredom
    Member

    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?

  2. dunglas commented on Feb 20, 2024

    @dunglas
    Member

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

  3. sawirricardo commented on Mar 14, 2024

    @sawirricardo

    what do you mean by copy/pasting?

  4. dunglas commented on Mar 14, 2024

    @dunglas
    Member

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

  5. sawirricardo commented on Mar 15, 2024

    @sawirricardo

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

  6. dunglas commented on Mar 15, 2024

    @dunglas
    Member

    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!

  7. emkcloud commented on Jun 28, 2025

    @emkcloud

    I have same problem. The problem is more complex. I have define cli_set_process_title after !function_esists() in helpers with return false; artisan tinker start without errors but i have problem with coding charset

    /opt/webserver/bin/frankenphp php-cli artisan tinker
    Psy Shell v0.12.9 (PHP 8.4.8 — cli) by Justin Hileman
    Error  Call to undefined function cli_set_process_title().
    
    if (!\function_exists('cli_set_process_title'))
    {
        function cli_set_process_title($title)
        {
            return false;
        }
    }
    

    Image

  8. henderkes commented on May 28, 2026

    @henderkes
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions