Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

pratik's avatar

PHP artisan doesn't work after updating composer

update php -> 7.3 and composer -> 2

create a new laravel project with laravel new

added database when tried running php artisan migrate got error

PHP Fatal error:  Uncaught Error: Class 'Illuminate\Foundation\Application' not found in /home/pratik/gitlab/blog/bootstrap/app.php:14
Stack trace:
#0 /home/pratik/gitlab/blog/artisan(20): require_once()
#1 {main}
  thrown in /home/pratik/gitlab/blog/bootstrap/app.php on line 14

tried solution

composer install --no-scripts
composer update --no-scripts
0 likes
10 replies
s4muel's avatar

is your laravel installer up to date? also try running composer dump-autoload

pratik's avatar

yes laravel installer is updated also composer dump-autoload show

Generating optimized autoload files
Class Illuminate\Foundation\ComposerScripts is not autoloadable, can not call post-autoload-dump script
> @php artisan package:discover --ansi
PHP Fatal error:  Uncaught Error: Class 'Illuminate\Foundation\Application' not found in /home/pratik/gitlab/Task/bootstrap/app.php:14
Stack trace:
#0 /home/pratik/gitlab/Task/artisan(20): require_once()
#1 {main}
  thrown in /home/pratik/gitlab/Task/bootstrap/app.php on line 14
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255

s4muel's avatar

i would try removing the vendor folder completely along with the composer.lock file and running composer install again, if that is an option

pratik's avatar

there was no composer.lock. i deleted vendor it showed this.

No lock file found. Updating dependencies instead of installing from lock file. Use composer update over composer install if you do not have a lock file.
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/framework[v8.12.0, ..., 8.x-dev] require ext-mbstring * -> it is missing from your system. Install or enable PHP's mbstring extension.
    - Root composer.json requires laravel/framework ^8.12 -> satisfiable by laravel/framework[v8.12.0, ..., 8.x-dev].
Sinnbeck's avatar

You are getting somewhere now. Install the requested extension. What development system are you running on? Mac? Windows (xampp?). You need to install it there.

pratik's avatar

I am using Ubuntu I did sudo apt-get install php-mbstring and my root composer.json already have

"require": {
        "php": "^7.3|^8.0",
        "fideloper/proxy": "^4.4",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "laravel/framework": "^8.12",
        "laravel/tinker": "^2.5"
    },
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

What version of php are you running? The error specifically says that it isn't installed. You can check installed modules using

php -m

if running php 7.4 try

sudo apt install php7.4-mbstring
pratik's avatar

PHP 7.3.24

[PHP Modules]
calendar
Core
ctype
curl
date
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
openssl
pcntl
pcre
PDO
Phar
posix
readline
Reflection
session
shmop
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache
pratik's avatar

did update sudo apt install php7.3-mbstring as i am on php 7.3

Please or to participate in this conversation.