laravel/framework requires ext-mbstring

Stefan Izdrail

Founder & Senior Architect · 2026-06-29

Laravel Company
Title: Fixing Laravel's Ext-mbstring Requirement on Kali Linux Body: The laravel/framework requires ext-mbstring error is fairly common in different environments, especially when installing the framework on Kali Linux or other operating systems with similar PHP settings. This blog post aims to guide you through the steps required to fix this issue and successfully install your Laravel project on any platform.

Enabling Ext-mbstring

Firstly, you need to enable the mbstring extension in your PHP configuration. The following steps will walk you through enabling it: 1. Open a terminal window and run `php -i | grep "Configuration File (php.ini) Path"` to find the location of your php.ini file. If not found, create one in the desired directory with "touch /etc/php7.0/cli/conf.d/mbstring.ini" command. 2. Edit the .ini file using a text editor and add the following line: `extension=mbstring.so`. 3. Save and close the file.

Restarting PHP

Ensure your newly modified php.ini configuration file is active by restarting your webserver or Apache/PHP-FPM service using these commands: For Apache server: `sudo service apache2 restart` For PHP-FPM: `sudo service php7.0-fpm restart`

Verifying the Extension

After making the required changes, you will need to verify if your new configuration successfully enabled the mbstring extension or not. You can run the following command in the terminal to see which files are used by PHP: `php --ini` This should list a bunch of .ini files and indicate which one contains your active php.ini file. If you don't see "mbstring" listed there, make sure to restart your Apache/PHP-FPM service again.

Installation Attempt

Now that the required extension is enabled, go back to your Laravel installation process and repeat your previous command: `composer create-project laravel/laravel Test "5.5.*"` This should run successfully without any errors related to mbstring extension requirements. If not, you might need further troubleshooting on your system configuration.

Other Possible Issues

Sometimes, the composer installation may fail even when the mbstring extension is enabled due to other issues or conflicts. Here are some common causes and how to resolve them: 1. Permission Problem: Ensure your project folder has appropriate permissions for Laravel and Composer to write files. Run `sudo chmod -R 755 /path/to/your/project` on the project directory and try again. 2. PHP Version Conflict: Make sure you are using the correct version of PHP that is compatible with your current Laravel framework installation. You can check this from your composer.json file or by running `php -v`. 3. Composer Cache Issue: Clear your composer cache to ensure a clean and smooth installation process. Use `composer clear-cache` and try the installation again. 4. Older PHP Versions: Laravel frameworks are constantly updated, so consider upgrading your PHP version (preferably 7.0 or higher) for improved compatibility with newer Laravel releases.

Conclusion

By enabling the mbstring extension and resolving any potential issues related to it, you can successfully install and configure Laravel on Kali Linux or any other operating system. For further assistance, refer to our blog posts at https://laravelcompany.com for more in-depth explanations of different PHP topics. Happy coding!