Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught Error: Call to undefined function Laravel\Installer\Console\mb_rtrim() #372

Closed
didix16 opened this issue Dec 11, 2024 · 4 comments · Fixed by #373
Closed

Uncaught Error: Call to undefined function Laravel\Installer\Console\mb_rtrim() #372

didix16 opened this issue Dec 11, 2024 · 4 comments · Fixed by #373
Labels

Comments

@didix16
Copy link

didix16 commented Dec 11, 2024

Installer Version

5.11.0

Description

I'm on Windows 11 machine using 8.2 PHP version.
While trying to install Laravel using the installer, after choosing the testing framework I've got an exception.

PHP Fatal error:  Uncaught Error: Call to undefined function Laravel\Installer\Console\mb_rtrim() in C:\Users\User\AppData\Roaming\Composer\vendor\laravel\installer\src\NewCommand.php:162
Stack trace:
#0 C:\Users\User\AppData\Roaming\Composer\vendor\symfony\console\Command\Command.php(279): Laravel\Installer\Console\NewCommand->execute()
#1 C:\Users\User\AppData\Roaming\Composer\vendor\symfony\console\Application.php(1029): Symfony\Component\Console\Command\Command->run()
#2 C:\Users\User\AppData\Roaming\Composer\vendor\symfony\console\Application.php(316): Symfony\Component\Console\Application->doRunCommand()
#3 C:\Users\User\AppData\Roaming\Composer\vendor\symfony\console\Application.php(167): Symfony\Component\Console\Application->doRun()
#4 C:\Users\User\AppData\Roaming\Composer\vendor\laravel\installer\bin\laravel(13): Symfony\Component\Console\Application->run()
#5 C:\Users\User\AppData\Roaming\Composer\vendor\bin\laravel(119): include('...')
#6 {main}
  thrown in C:\Users\User\AppData\Roaming\Composer\vendor\laravel\installer\src\NewCommand.php on line 162

Steps To Reproduce

$ laravel new test-app

 Would you like to install a starter kit? [No starter kit]:
  [none     ] No starter kit
  [breeze   ] Laravel Breeze
  [jetstream] Laravel Jetstream
 > breeze


 Which Breeze stack would you like to install? [Blade with Alpine]:
  [blade              ] Blade with Alpine
  [livewire           ] Livewire (Volt Class API) with Alpine
  [livewire-functional] Livewire (Volt Functional API) with Alpine
  [react              ] React with Inertia
  [vue                ] Vue with Inertia
  [api                ] API only
 > react


 Would you like any optional features? [None]:
  [none      ] None
  [dark      ] Dark mode
  [ssr       ] Inertia SSR
  [typescript] TypeScript
  [eslint    ] ESLint with Prettier
 > typescript,dark


 Which testing framework do you prefer? [Pest]:
  [0] Pest
  [1] PHPUnit
 >

PHP Fatal error:  Uncaught Error: Call to undefined function Laravel\Installer\Console\mb_rtrim() in C:\Users\User\AppData\Roaming\Composer\vendor\laravel\installer\src\NewCommand.php:162
...
@crynobone
Copy link
Member

crynobone commented Dec 11, 2024

@didix16 Thanks for the report. It seems like your installation missing mbstring extension or PHP 8.4

To solve this without waiting for a new installer release you should be able to run the following:

composer global require symfony/polyfill-mbstring

@didix16
Copy link
Author

didix16 commented Dec 11, 2024

Thanks for you fast response @crynobone !

@crynobone
Copy link
Member

@didix16 After looking deeper into this, it seems that Laravel Framework does require mbstring extension and your installation would still failed: https://laravel.com/docs/11.x/deployment#server-requirements

@didix16
Copy link
Author

didix16 commented Dec 11, 2024

@crynobone I've had already activated the mbstring extension. I had it since I was installed the PHP 8.2 version. I just installed the symfony/polyfill-mbstring package globally and worked like a charm. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants