deploying php laravel on app engine errors

this is my first time deploying to gcp app engine.i got the following error any ideas on how to solve it 

 

In PackageManifest.php line 178:

                                                                          

  The /workspace/bootstrap/cache directory must be present and writable.  

Solved Solved
2 4 512
1 ACCEPTED SOLUTION

Hello @Danny69,

Welcome to the Google Cloud Community!

You can do the following troubleshooting options:

  1. Take a look at this Stack Overflow post. You can add the following paths under your environment variables in your app.yaml
    APP_SERVICES_CACHE: /tmp/services.php
    APP_PACKAGES_CACHE: /tmp/packages.php
    APP_CONFIG_CACHE: /tmp/config.php
    APP_ROUTES_CACHE: /tmp/routes.php
  2. Check out this Github issue. You can add the following line to the post-autoload-dump in your composer.json. You can also copy the part mentioned in the comment as it also provides additional setup to the composer.json.
    "mkdir -p ./bootstrap/cache/",
  3. If the above options don't work, you can contact Google Cloud Support to further look into your case. Hope it helped, thanks!

View solution in original post

4 REPLIES 4

Hello @Danny69,

Welcome to the Google Cloud Community!

You can do the following troubleshooting options:

  1. Take a look at this Stack Overflow post. You can add the following paths under your environment variables in your app.yaml
    APP_SERVICES_CACHE: /tmp/services.php
    APP_PACKAGES_CACHE: /tmp/packages.php
    APP_CONFIG_CACHE: /tmp/config.php
    APP_ROUTES_CACHE: /tmp/routes.php
  2. Check out this Github issue. You can add the following line to the post-autoload-dump in your composer.json. You can also copy the part mentioned in the comment as it also provides additional setup to the composer.json.
    "mkdir -p ./bootstrap/cache/",
  3. If the above options don't work, you can contact Google Cloud Support to further look into your case. Hope it helped, thanks!

Thanks for your help. but I went to use compute engine. I created the virtual machine deployed my app it works I can access my login page. I do have a second challenge which is the database. I have a data base on my local machine I also use phpmyadmin there. should I create a cloud sql instance for my database and then upload the .sql file there?

You need to set 755 on your bootstrap cache file. Look at my docker file. 

RUN chmod +x /usr/local/bin/entrypoint.sh && \
composer install --no-dev && \
npm install && \
chmod -R 775 node_modules && \
npm run build && \
chmod -R 775 public/build && \
php artisan cache:clear && \
php artisan optimize:clear && \
php artisan route:clear && \
chown -R www-data:www-data /var/www/html && \
chmod -R 755 /var/www/html/storage && \
chmod -R 755 /var/www/html/bootstrap/cache && \
php artisan storage:link && \
php artisan cache:clear && \

Thanks for your help. but I went to use compute engine. I created the virtual machine deployed my app it works I can access my login page. I do have a second challenge which is the database. I have a data base on my local machine I also use phpmyadmin there. should I create a cloud sql instance for my database and then upload the .sql file there?