Skip to content

Call to undefined function Illuminate\Support\mb_split() #665

@xTrimy

Description

@xTrimy

What were you trying to do?

The app was working fine until this error started appearing. Call to undefined function Illuminate\Support\mb_split()

I was trying to run php artisan native:serve normally. The app didn't start and the console logs was stuck on


 Running the dev script with npm...

 Fetching latest dependencies…`

I then tried to run php artisan native:serve -vvv

The following logs appeared:

checkForUpdatesAndNotify called, downloadPromise is null
Electron API server started on port 4000
Starting PHP server... E:\Work\test-laravel\vendor\nativephp\electron\resources\js\resources\php\php.exe artisan serve E:\Work\test-laravel []
Copying storage folder...
Storage path: C:\Users\xTrimy\AppData\Roaming\laravel-dev\storage
App path: E:\Work\test-laravel
Making sure app folders are available
Linking storage path...
Calling PHP E:\Work\test-laravel\vendor\nativephp\electron\resources\js\resources\php\php.exe [
  '-d',
  'openssl.cafile=E:\\Work\\test-laravel\\vendor\\nativephp\\electron\\resources\\js\\resources\\cacert.pem',
  '-d',
  'curl.cainfo=E:\\Work\\test-laravel\\vendor\\nativephp\\electron\\resources\\js\\resources\\cacert.pem',
  '-d',
  'memory_limit=512M',
  'artisan',
  'storage:link',
  '--force'
]
Skipping Database migration while in development.
You may migrate manually by running: php artisan native:migrate
Starting PHP server...
* * * Running from source * * *
Calling PHP E:\Work\test-laravel\vendor\nativephp\electron\resources\js\resources\php\php.exe [
  '-d',
  'openssl.cafile=E:\\Work\\test-laravel\\vendor\\nativephp\\electron\\resources\\js\\resources\\cacert.pem',
  '-d',
  'curl.cainfo=E:\\Work\\test-laravel\\vendor\\nativephp\\electron\\resources\\js\\resources\\cacert.pem',
  '-d',
  'memory_limit=512M',
  '-S',
  '127.0.0.1:8100',
  'E:\\Work\\test-laravel\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\resources\\server.php'
]
PHP Server started on port:  8100
[Sat Jul 26 18:10:13 2025] 127.0.0.1:51420 [POST] URI: /_native/api/booted
Process [queue_default] spawned!

Please check your log files:
  C:\Users\xTrimy\AppData\Roaming\laravel-dev\storage\logs

[Sat Jul 26 18:10:14 2025] 127.0.0.1:51422 [POST] URI: /_native/api/events

Please check your log files:
  C:\Users\xTrimy\AppData\Roaming\laravel-dev\storage\logs

Error in PHP:
  Call to undefined function Illuminate\Support\mb_split() (0) in E:\Work\test-laravel\vendor\laravel\framework\src\Illuminate\Support\Str.php:1700
Error in PHP:
  Call to undefined function Illuminate\Support\mb_split() (0) in E:\Work\test-laravel\vendor\laravel\framework\src\Illuminate\Support\Str.php:1700
[Sat Jul 26 18:10:14 2025] 127.0.0.1:51426 [POST] URI: /_native/api/events

Please check your log files:
  C:\Users\xTrimy\AppData\Roaming\laravel-dev\storage\logs

Error in PHP:
  Call to undefined function Illuminate\Support\mb_split() (0) in E:\Work\test-laravel\vendor\laravel\framework\src\Illuminate\Support\Str.php:1700
[Sat Jul 26 18:10:15 2025] 127.0.0.1:51430 [POST] URI: /_native/api/events

Please check your log files:
  C:\Users\xTrimy\AppData\Roaming\laravel-dev\storage\logs

Error in PHP:
  Call to undefined function Illuminate\Support\mb_split() (0) in E:\Work\test-laravel\vendor\laravel\framework\src\Illuminate\Support\Str.php:1700
[Sat Jul 26 18:10:15 2025] 127.0.0.1:51434 [POST] URI: /_native/api/events

Please check your log files:
  C:\Users\xTrimy\AppData\Roaming\laravel-dev\storage\logs

Error in PHP:
  Call to undefined function Illuminate\Support\mb_split() (0) in E:\Work\test-laravel\vendor\laravel\framework\src\Illuminate\Support\Str.php:1700
[Sat Jul 26 18:10:16 2025] 127.0.0.1:51438 [POST] URI: /_native/api/events

Please check your log files:
  C:\Users\xTrimy\AppData\Roaming\laravel-dev\storage\logs

Error in PHP:
  Call to undefined function Illuminate\Support\mb_split() (0) in E:\Work\test-laravel\vendor\laravel\framework\src\Illuminate\Support\Str.php:1700
[Sat Jul 26 18:10:16 2025] 127.0.0.1:51442 [POST] URI: /_native/api/events

Please check your log files:
  C:\Users\xTrimy\AppData\Roaming\laravel-dev\storage\logs

Error in PHP:
  Call to undefined function Illuminate\Support\mb_split() (0) in E:\Work\test-laravel\vendor\laravel\framework\src\Illuminate\Support\Str.php:1700

What happened?

The app doesn't work with the nativephp's php binaries. I tried to run the laravel server (browser) it works perfectly.
I even tried to create a new fresh project. Same error.

How to reproduce the bug

Fresh install of nativephp project and run php artisan native:serve

Debug Output

Array
(
[Environment] => Array
(
[PHP] => Array
(
[Version] => 8.3.22
[Path] => C:\Users\xTrimy.pvm\versions\php-8.3.22-Win32-vs16-x64\php.exe
)

        [Laravel] => Array
            (
                [Version] => 12.21.0
                [ConfigCached] =>
                [RoutesCached] =>
                [DebugEnabled] => 1
            )

        [Node] => Array
            (
                [Version] => v22.17.0
                [Path] => C:\Program Files\nodejs\node.exe
            )

        [NPM] => Array
            (
                [Version] => 10.9.2
                [Path] => C:\Program Files\nodejs\npm

C:\Program Files\nodejs\npm.cmd
)

        [OperatingSystem] => WINNT
    )

[NativePHP] => Array
    (
        [Versions] => Illuminate\Support\Collection Object
            (
                [items:protected] => Array
                    (
                        [nativephp/electron] => 1.1.1.0
                        [nativephp/laravel] => 1.1.2.0
                        [nativephp/php-bin] => 1.0.3.0
                    )

                [escapeWhenCastingToString:protected] =>
            )

        [Configuration] => Array
            (
                [Provider] => App\Providers\NativeAppServiceProvider
                [BuildHooks] => Array
                    (
                        [Pre] => Array
                            (
                            )

                        [Post] => Array
                            (
                            )

                    )

                [NotarizationEnabled] =>
                [CustomPHPBinary] =>
            )

    )

)

Which operating systems have you seen this occur on?

Windows

Notes

No response

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