Laradock / Laravel deploy to App Engine Flexible not working

148 views
Skip to first unread message

Mike P

unread,
Jan 14, 2019, 5:10:21 PM1/14/19
to Google App Engine
I'm trying to deploy my new Laravel project, however it fails as apparently 'bcmath' is missing.

I tried copying laradock's php.ini in the root of my project, but it doesn't seem to work. Any clue on how I can fix this? I've been at this for a couple of hours.
 
This is the log:
starting build "bf1c72af-78f7-488b-bf02-8d0277ffbafe"

FETCHSOURCE
Fetching storage object: gs://staging.wab-taco.appspot.com/eu.gcr.io/wab-taco/appengine/default.20190114t151355:latest#1547475265031675
Copying gs://staging.wab-taco.appspot.com/eu.gcr.io/wab-taco/appengine/default.20190114t151355:latest#1547475265031675...
/ [0 files][ 0.0 B/ 20.2 MiB] 
/ [0 files][264.0 KiB/ 20.2 MiB] 
-
- [0 files][ 4.1 MiB/ 20.2 MiB] 
\
\ [1 files][ 20.2 MiB/ 20.2 MiB] 
Operation completed over 1 objects/20.2 MiB. 
BUILD
Starting Step #0
Step #0: Pulling image: gcr.io/gcp-runtimes/php/gen-dockerfile@sha256:d699fc436cdad6ca70ba189f792e9a38baefd5339ee7145570c569aefcc45a36
Step #0: sha256:d699fc436cdad6ca70ba189f792e9a38baefd5339ee7145570c569aefcc45a36: Pulling from gcp-runtimes/php/gen-dockerfile
Step #0: Digest: sha256:d699fc436cdad6ca70ba189f792e9a38baefd5339ee7145570c569aefcc45a36
Step #0: Status: Downloaded newer image for gcr.io/gcp-runtimes/php/gen-dockerfile@sha256:d699fc436cdad6ca70ba189f792e9a38baefd5339ee7145570c569aefcc45a36
Step #0: + php /builder/create_dockerfile.php create --php72-image gcr.io/google-appengine/php72@sha256:0f0d6c07035fd5138d917b4d539f4473ca13528f11c26c92be54b9e33c0f722b --php71-image gcr.io/google-appengine/php71@sha256:5531e7edb33a0337440311e9ff8f012f1cd554c50bb9788eea3f96405004cfd3 --php70-image gcr.io/google-appengine/php70@sha256:99731221e941d57a6807d9eb5491474d06488c2e8fcd9552227fb2d120e35c89 --php56-image gcr.io/google-appengine/php56@sha256:70ac0d926c59517ea94897409dfa7c72a12c0e38d59f4a60794e910cdb2cdb02
Finished Step #0
Starting Step #1
Step #1: Pulling image: gcr.io/kaniko-project/executor@sha256:f87c11770a4d3ed33436508d206c584812cd656e6ed08eda1cff5c1ee44f5870
Step #1: sha256:f87c11770a4d3ed33436508d206c584812cd656e6ed08eda1cff5c1ee44f5870: Pulling from kaniko-project/executor
Step #1: 042c12654203: Pulling fs layer
Step #1: e623e7f7d83e: Pulling fs layer
Step #1: 4a78c04d4eaa: Pulling fs layer
Step #1: bf1e1a1d843a: Pulling fs layer
Step #1: bde2bd8edab4: Pulling fs layer
Step #1: 9c94fd449ba4: Pulling fs layer
Step #1: c1edeb5aef20: Pulling fs layer
Step #1: bf1e1a1d843a: Waiting
Step #1: bde2bd8edab4: Waiting
Step #1: 9c94fd449ba4: Waiting
Step #1: c1edeb5aef20: Waiting
Step #1: e623e7f7d83e: Verifying Checksum
Step #1: e623e7f7d83e: Download complete
Step #1: 4a78c04d4eaa: Verifying Checksum
Step #1: 4a78c04d4eaa: Download complete
Step #1: 042c12654203: Verifying Checksum
Step #1: 042c12654203: Download complete
Step #1: bde2bd8edab4: Verifying Checksum
Step #1: bde2bd8edab4: Download complete
Step #1: c1edeb5aef20: Verifying Checksum
Step #1: c1edeb5aef20: Download complete
Step #1: bf1e1a1d843a: Verifying Checksum
Step #1: bf1e1a1d843a: Download complete
Step #1: 9c94fd449ba4: Verifying Checksum
Step #1: 9c94fd449ba4: Download complete
Step #1: 042c12654203: Pull complete
Step #1: e623e7f7d83e: Pull complete
Step #1: 4a78c04d4eaa: Pull complete
Step #1: bf1e1a1d843a: Pull complete
Step #1: bde2bd8edab4: Pull complete
Step #1: 9c94fd449ba4: Pull complete
Step #1: c1edeb5aef20: Pull complete
Step #1: Digest: sha256:f87c11770a4d3ed33436508d206c584812cd656e6ed08eda1cff5c1ee44f5870
Step #1: Status: Downloaded newer image for gcr.io/kaniko-project/executor@sha256:f87c11770a4d3ed33436508d206c584812cd656e6ed08eda1cff5c1ee44f5870
Step #1: INFO[0000] Removing ignored files from build context: [.dockerignore Dockerfile .git .hg .svn *~ .\#* app.yaml] 
Step #1: INFO[0001] Downloading base image gcr.io/google-appengine/php72@sha256:0f0d6c07035fd5138d917b4d539f4473ca13528f11c26c92be54b9e33c0f722b 
Step #1: INFO[0013] Taking snapshot of full filesystem... 
Step #1: INFO[0020] ENV DOCUMENT_ROOT='/app/public' APP_LOG='errorlog' APP_KEY='base64:ak4/ZLdvSpRF3JDRPuR8mgzzGB8GXGuLVF/PP8qnTH4=' STORAGE_DIR='/tmp' FRONT_CONTROLLER_FILE='index.php' COMPOSER_FLAGS='--no-dev --prefer-dist' DETECTED_PHP_VERSION='7.2' 
Step #1: INFO[0020] Using files from context: [/workspace] 
Step #1: INFO[0020] COPY . $APP_DIR 
Step #1: INFO[0022] Taking snapshot of files... 
Step #1: INFO[0024] RUN chown -R www-data.www-data $APP_DIR 
Step #1: INFO[0024] cmd: /bin/sh 
Step #1: INFO[0024] args: [-c chown -R www-data.www-data $APP_DIR] 
Step #1: INFO[0024] Taking snapshot of full filesystem... 
Step #1: INFO[0032] RUN /build-scripts/composer.sh 
Step #1: INFO[0032] cmd: /bin/sh 
Step #1: INFO[0032] args: [-c /build-scripts/composer.sh] 
Step #1: Using PHP version: 7.2
Step #1: Install PHP extensions...
Step #1: Running composer...
Step #1: Loading composer repositories with package information
Step #1: Installing dependencies from lock file
Step #1: Your requirements could not be resolved to an installable set of packages.
Step #1: 
Step #1: Problem 1
Step #1: - Installation request for moontoast/math 1.1.2 -> satisfiable by moontoast/math[1.1.2].
Step #1: - moontoast/math 1.1.2 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
Step #1: Problem 2
Step #1: - moontoast/math 1.1.2 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
Step #1: - laravel/telescope v1.0.10 requires moontoast/math ^1.1 -> satisfiable by moontoast/math[1.1.2].
Step #1: - Installation request for laravel/telescope v1.0.10 -> satisfiable by laravel/telescope[v1.0.10].
Step #1: 
Step #1: To enable extensions, verify that they are enabled in your .ini files:
Step #1: - /opt/php72/lib/php-cli.ini
Step #1: - /opt/php72/lib/ext.enabled/ext-apcu-bc.ini
Step #1: - /opt/php72/lib/ext.enabled/ext-mailparse.ini
Step #1: - /opt/php72/lib/ext.enabled/ext-memcached.ini
Step #1: You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Step #1: error building image: error building stage: waiting for process to exit: exit status 2
Finished Step #1
ERROR
ERROR: build step 1 "gcr.io/kaniko-project/executor@sha256:f87c11770a4d3ed33436508d206c584812cd656e6ed08eda1cff5c1ee44f5870" failed: exit status 1

Mike P

unread,
Jan 15, 2019, 9:14:07 AM1/15/19
to Google App Engine
Well. After hours of trying a bunch of different things, I emptied my head, sat down again and started at the beginning. It was then I realized how stupid I've been.

Anyhow, the extension bcmath was missing. I thought I read somewhere that by default, the bcmath extension was turned on in the Google App Engine's PHP runtime. This was not the case.

So after slowly reading this https://cloud.google.com/appengine/docs/flexible/php/runtime I figured out that all I needed to do was enable the bcmath extension in my composer.json as Google Cloud reads from this file.

"name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": "^7.1.3",
        "fideloper/proxy": "^4.0",
        "laravel/framework": "5.7.*",
        "laravel/telescope": "^1.0",
        "laravel/tinker": "^1.0",
        "ext-bcmath": "*"
    },

I added the "ext-bcmath", deployed the app and it worked!

Reply all
Reply to author
Forward
0 new messages