22

This is driving me crazy second day. I'm new to Laravel and trying to get Laravel 6 work on Google App Engine Standard. Tried: This tutorial and other ones, but it still fails to load Laravel index page

What I have done:

  1. Created new Laravel project

  2. Checked that Laravel is working on local host with php artisan serve

  3. Generated new key with php artisan key:generate --show

  4. Created app.yaml file with:

runtime: php72

env_variables:
  APP_KEY: iktbUa2quYPV2av3zDx0XAuEVjwzVQY/oMfyI2PQNKk=
  APP_STORAGE: /tmp
  VIEW_COMPILED_PATH: /tmp
  SESSION_DRIVER: cookie
  1. Modified bootstrap/app.php by adding $app->useStoragePath(env('APP_STORAGE', base_path() . '/storage'));

  2. Rancomposer remove --dev beyondcode/laravel-dump-server

  3. Also ran: php artisan cache:clear, php artisan route:cache, php artisan config:clear, php artisan view:clear (as other tutorials suggested)

  4. And gcloud app deploy

And I get error: "Class 'Facade\Ignition\IgnitionServiceProvider' not found"

enter image description here

ProgZi
  • 1,028
  • 3
  • 14
  • 25

11 Answers11

47

If you're facing this issue after upgrading composer 1.0 to 2.0. Then you can follow this step:

  1. Go to the project directory
  2. Run composer install
  3. Run composer dump-autoload
  4. Try to run php artisan serve It solved for me
Abid Rakhmansyah
  • 896
  • 8
  • 22
9

Please Try

composer dump-autoload

It solved for me

Asadut Zaman
  • 273
  • 3
  • 6
  • This broke my all application. – Krishna Karki Feb 25 '21 at 09:57
  • @KrishnaKarki This just ensures that your dependency files are properly getting discovered and loaded. It def shouldn't break your application, unless the dependencies themselves correctly break your application, or unless you have a discrepancy in your composer versions (i.e. installed the initial deps with composer v1, and installed new deps with v2, etc.) – Aaron Krauss Jul 19 '21 at 17:19
  • This helped out! Thank you so much. Any idea what just happened to understand this more technically? – Harry Sep 08 '22 at 11:19
8

App engine install dependency with "--no-dev" flag. If your application is debug mode and there is an error application is try to render error page by "facade/ignition" packages.

Solve-1: You can move "facade/ignition" dependency from "require-dev" to "dev" in composer.json file

Solve-2: You can run as production environment and with false APP_DEBUG flag

5

I have experienced other errors as well, most of them gave me Error 500 and

nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /tmp/google-config/nginx.conf:3 in Stackdriver Logger

Also I was not aware that App Engine was executing composer.json on build (see Specifying Dependencies). And it seems the issue was that it cached that.

Everything was resolved by replacing command in step 7. :

gcloud app deploy with gcloud beta app deploy --no-cache

It seems that if I would have done all steps as in tutorial from the start I would not have any issues.

ProgZi
  • 1,028
  • 3
  • 14
  • 25
4

I try composer update and its working fine

3

Try

php artisan route:clear

and you're good to go.

lczapski
  • 4,026
  • 3
  • 16
  • 32
Chris
  • 31
  • 1
3

Try running

composer update

or

composer dump-autoload
hackernewbie
  • 1,606
  • 20
  • 13
2

Go to your project terminal and run :

  1. composer install

  2. composer dump-autoload

  3. php artisan serve

And your problem will go away.

Besworks
  • 4,123
  • 1
  • 18
  • 34
1

I am also new to Laravel and I have experienced with this issue, and I searched solution which was

  • first run this command on your terminal

composer update

  • second run the command on below

composer dump-autoload

and then see the result :)

Jaro
  • 1,587
  • 5
  • 20
  • 39
  • In my case, I need run `composer dump-autoload` to use my helpers. It works for me… and update my laravel project from v7.28 to v7.30 ! – bcag2 Oct 19 '22 at 14:15
0

just uncomment soduim line from your ini file

before

;extension=sodium

after

extension=sodium
Hadayat Niazi
  • 1,991
  • 3
  • 16
  • 28
-1

If you are facing this issue while running phpUnit tests then try to clear cache of bootstrap folder.

Kapil Verma
  • 178
  • 3
  • 17