Local Plugin management fails
I have a wordpress setup running in the Standard Environment. Execution locally with CloudSQL also works.
But performing Plugin maintenance via wp always fails:
# vendor/bin/wp plugins list --path=wordpress
PHP Warning: require_once(google/appengine/api/urlfetch_service_pb.php): failed to open stream: No such file or directory in /Users/Sebastian.Just/development/workspaces/gcp/wordpress2/wordpress/wp-content/plugins/google-app-engine/modules/urlfetch.php on line 72
Warning: require_once(google/appengine/api/urlfetch_service_pb.php): failed to open stream: No such file or directory in /Users/Sebastian.Just/development/workspaces/gcp/wordpress2/wordpress/wp-content/plugins/google-app-engine/modules/urlfetch.php on line 72
PHP Fatal error: require_once(): Failed opening required 'google/appengine/api/urlfetch_service_pb.php' (include_path='.:') in /Users/Sebastian.Just/development/workspaces/gcp/wordpress2/wordpress/wp-content/plugins/google-app-engine/modules/urlfetch.php on line 72
Fatal error: require_once(): Failed opening required 'google/appengine/api/urlfetch_service_pb.php' (include_path='.:') in /Users/Sebastian.Just/development/workspaces/gcp/wordpress2/wordpress/wp-content/plugins/google-app-engine/modules/urlfetch.php on line 72
And it's true - those files really don't exist starting with google/appengine/ - but I'm unsure how the required_once even makes up those file names
Can I use the local server to update/install plugins or will this screw up some file paths in the Wordpress database?
@derjust Sorry for the late reply.
Hm, I think you're using that script for App Engine standard, right?
The WordPress project for GAE standard may need to have google/appengine-php-sdk.
Can you try adding the following to your composer.json, then run composer update then try again?
Like this:
{
"require-dev": {
"google/appengine-php-sdk": "^1.9",
"wp-cli/wp-cli": "~1.1"
}
}
You can get rid of this error by commenting that block of 4 "require" statements around line 72 or urlfetch `// TODO(slangley): Remove when autoloading is shipped.
//require_once 'google/appengine/ext/cloud_storage_streams/HttpResponse.php'; //require_once 'google/appengine/api/urlfetch_service_pb.php'; //require_once 'google/appengine/runtime/ApiProxy.php'; //require_once 'google/appengine/runtime/ApplicationError.php'; `
I haven't fully tested the code but the wp command seems to work without error.
I have the same issue here. Hope this will be fixed soon.
I tried the above method (insert the "google/appengine-php-sdk": "^1.9" to composer.json) However, the same issue exists. The required files really exist the subdirectories in "/vendor/google/appengine-php-sdk/google" which is in the project root directory. I try to look the source code. I believe the problem might be the environment variables. Nonetheless, I try not to activate google-app-engine in the local server. This plugin can be activated in the actual Google App Engine. Still I hope this issue can be fixed. I wish I have the ability to fix it :)
@tmatsuo hey Takashi, can you look into whether or not we can remove those 4 lines that @jim-bo referred to? I'm running into the same problem as the original poster when testing WordPress on App Engine Standard locally (but it works if I comment out those 4 lines). Thanks!
@ryanmats Probably not, but I'm not sure.
Is it possible to change the include_path settings for your local php?
Ping. Any progress on this? It makes WordPress on AE Standard pretty much a no-go if it cant be upgraded.
Adding
{
"require-dev": {
"google/appengine-php-sdk": "^1.9",
"wp-cli/wp-cli": "~1.1"
}
}
to composer.json and running composer.update does not seem to fix the problem.
How might one "change the include_path settings for your local php?"
After installing google/appengine-php-sdk, the following command worked for me:
WP_CLI_PHP_ARGS='-d include_path=vendor/google/appengine-php-sdk' vendor/bin/wp --path=wordpress plugin list
Thanks. I'll try that out. Assuming it works, we should update the instructions to include that.
I'm not super familiar with wordpress/php, but I have replicated the following issue on osx and debian, starting with the current instructions:
- works fine deployed
- cannot run server locally (required to install plugins afaict)
- error is the
Failed opening required 'google/appengine/api/urlfetch_service_pb.php'noted in the docs - setting WP_CLI_PHP_ARGS has no effect
- modifying the include_path in php.ini to /PROJECT_FOLDER/vendor/google/appengine-php-sdk causes a new error:
Fatal error: Class 'google\appengine\runtime\Error' not found in /PROJECT_FOLDER/vendor/google/appengine-php-sdk/google/appengine/runtime/ApplicationError.php on line 22
Any updates on this? same as @jlivni
I see there are new docs available using v7.2 and the gcloud (vs older SDK); I'm going to close the issue since I think this version is obsolete now that the newer version is available and working.
https://github.com/GoogleCloudPlatform/php-docs-samples/tree/master/appengine/php72/wordpress