frankenphp icon indicating copy to clipboard operation
frankenphp copied to clipboard

PHP stan error while running parallel worker

Open kevincobain2000 opened this issue 4 months ago • 3 comments
trafficstars

What happened?

Setup

╰─$ which php
/Users/me/.local/bin/php
╰─$ which frankenphp                                                                                                       1 ↵
/usr/local/bin/frankenphp

╰─$ frankenphp --version
FrankenPHP 1.5.0 PHP 8.4.7 Caddy v2.10.0 h1:fonubS....

Script From https://frankenphp.dev/docs/known-issues/#composer-scripts-referencing-php

╰─$ cat /Users/me/.local/bin/php
#!/usr/bin/env bash
args=("$@")
index=0
for i in "$@"
do
    if [ "$i" == "-d" ]; then
        unset 'args[$index]'
        unset 'args[$index+1]'
    fi
    index=$((index+1))
done

/usr/local/bin/frankenphp php-cli ${args[@]}

PHP Stan errors composer, phpunit, phpcs all others work just fine

╰─$ ./vendor/bin/phpstan analyse --memory-limit=2G
Note: Using configuration file /project/phpstan.neon.
 349/349 [ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“] 100%

 -- --------------------------------------------------------------------------------------
     Error
 -- --------------------------------------------------------------------------------------
     Child process error (exit code 1):

       Command "/project/php.ini" is not defined.


      while running parallel worker
 -- --------------------------------------------------------------------------------------



 [ERROR] Found 1 error


āš ļø  Result is incomplete because of severe errors. āš ļø
   Fix these errors first and then re-run PHPStan
   to get all reported errors.

Build Type

Standalone binary

Worker Mode

Yes

Operating System

macOS

CPU Architecture

x86_64

PHP configuration

-

Relevant log output


kevincobain2000 avatar Jun 21 '25 08:06 kevincobain2000

I’m not sure this is related to PHP or FrankenPHP. It looks like you have the following issue:

Command "/project/php.ini" is not defined.

You seem to be missing a php.ini file in your project directory; or are trying to execute the ini file. The error isn't clear.

withinboredom avatar Jun 21 '25 13:06 withinboredom

Ah I am sorry I had left the php.ini placed in that folder, while I was debugging. Without any php.ini in that file, I have following.

I ll try with -vvv option on the phpstan and see what it is missing, cuz it doesn't work out of the box

╰─$ php ./vendor/bin/phpstan analyse  --memory-limit=2G
 349/349 [ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“] 100%

 -- ----------------------------------------------------
     Error
 -- ----------------------------------------------------
     Child process error (exit code 1):

       Command "./vendor/bin/phpstan" is not defined.


      while running parallel worker
 -- ----------------------------------------------------



 [ERROR] Found 1 error


āš ļø  Result is incomplete because of severe errors. āš ļø
   Fix these errors first and then re-run PHPStan
   to get all reported errors.

kevincobain2000 avatar Jun 21 '25 14:06 kevincobain2000

Did you read the error message before replying?

withinboredom avatar Jun 21 '25 16:06 withinboredom