I have a PHP that runs fine on localhost but throws error on the cloud server. On the localhost, the script runs and also fetched the data from datastore.
This is the line thats causing the problem:
require __DIR__ . '/../../vendor/autoload.php';
// this is the line5 of datastore.php
I deploy it using this code: gcloud app deploy --promote --stop-previous-version app.yaml
After deploying to the Google AppEngine, i get this:
Warning: require(/base/data/home/apps/myproject/projectID/dialpad_research/api/../../vendor/autoload.php): failed to open stream: No such file or directory in /base/data/home/apps/myproject/projectID/dialpad_research/api/datastore.php on line 5 Fatal error: require(): Failed opening required '/base/data/home/apps/myproject/projectID/dialpad_research/api/../../vendor/autoload.php' (include_path='.;/base/data/home/apps/myproject/projectID/;/base/alloc/tmpfs/dynamic_runtimes/php55_dynamic/ef537742f8701211/sdk') in /base/data/home/apps/myproject/projectID/dialpad_research/api/datastore.php on line 5
This file is required inside another PHP file too. But even if I try to access this file directly, I still get the same error.
Should I be adding the require code differently?
composer installwhen you deploy? - jeroen