php-docs-samples icon indicating copy to clipboard operation
php-docs-samples copied to clipboard

Local Plugin management fails

Open derjust opened this issue 9 years ago • 14 comments

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 avatar Feb 02 '17 04:02 derjust

@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"
    }
}

tmatsuo avatar Feb 28 '17 06:02 tmatsuo

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.

jim-bo avatar May 11 '17 03:05 jim-bo

I have the same issue here. Hope this will be fixed soon.

cmwang-cottageclothing avatar Aug 12 '17 11:08 cmwang-cottageclothing

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 :)

cmwang-cottageclothing avatar Aug 14 '17 07:08 cmwang-cottageclothing

@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 avatar Sep 22 '17 01:09 ryanmats

@ryanmats Probably not, but I'm not sure.

Is it possible to change the include_path settings for your local php?

tmatsuo avatar Sep 22 '17 03:09 tmatsuo

Ping. Any progress on this? It makes WordPress on AE Standard pretty much a no-go if it cant be upgraded.

elharo avatar Dec 08 '17 19:12 elharo

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.

elharo avatar Dec 08 '17 19:12 elharo

How might one "change the include_path settings for your local php?"

elharo avatar Dec 08 '17 20:12 elharo

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

tmatsuo avatar Dec 12 '17 18:12 tmatsuo

Thanks. I'll try that out. Assuming it works, we should update the instructions to include that.

elharo avatar Dec 12 '17 18:12 elharo

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

jlivni avatar Jul 02 '18 02:07 jlivni

Any updates on this? same as @jlivni

chriscoderdr avatar Sep 04 '18 02:09 chriscoderdr

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

jlivni avatar Sep 25 '18 20:09 jlivni