Comments (10)
So it turns out that the vendor
folder inside of the gcs
plugin isn't even being uploaded when running the gcloud app deploy
command, as the tutorial suggests. See the screenshot below.
Commenting out the following line from the .gcloudignore
file in the root of my project directory and redeploying my site to App Engine resolved the issue, as the vendor
folder was included this time. I don't know if this is best practice but it did work for me.
# PHP Composer dependencies:
vendor/
from wordpress-plugins.
@ran-dall Well, I have no composer.json
in my project structure. I'm certainly not a PHP guy so I just learned about Composer yesterday. My point is just that I followed the tutorial on GCP's website, step by step, and it didn't work, which puzzled me quite a bit.
from wordpress-plugins.
I followed the steps of GCP's tutorial here: https://cloud.google.com/community/tutorials/run-wordpress-on-appengine-standard
And just like @ccherchi I ran into this issue. Is there still no fix for this? Since I ran since in a clean GCP project, I am imagining that other users following the tutorial will experience exactly the same issue.
from wordpress-plugins.
I've not dug into this myself - you might find this useful though...
You can find details relating to this here:
https://cloud.google.com/appengine/docs/standard/php7/specifying-dependencies
Note the following:
- Composer runs automatically when you deploy a new version of your application.
- By default, the
vendor/
directory is ignored in the generated .gcloudignore file to reduce the number of files sent in deployment.
No real answers from me here, just an observation.
from wordpress-plugins.
The problem is exactly what @sebastianbk described above. The first time you run gcloud app deploy
, it generates a .gcloudignore
which adds /vendor/
but Google bundles vendor dependencies directly in the gcs
plugin so it's preventing itself from working.
I ended up removing it from both .gcloudignore
and .gitignore
to make it easy to develop and deploy.
from wordpress-plugins.
Ignoring vendor/
is a problem since there are plugins that use composer to bundle libraries. This means those too will malfunction.
from wordpress-plugins.
Thank you @ran-dall This indeed does clarify a few points for me. 90% of plugins I deploy to app engine are in private repos. I'll need to figure out how to add those using composer. What you describe does make sense.
from wordpress-plugins.
@sebastianbk Actually, @DeanMarkTaylor kinda has the answer for you. The vendor
folder is missing because it's supposed to be built for you when you deploy when it runs Composer
automatically for you. So I'd check your composer.json
.
from wordpress-plugins.
@FrankM1 and @Zertz When you upload an application, you should be specifying your dependencies in a composer.json
file. When Composer
runs, it will automatically create the vendor
directories.
The ignored action is best practice, as you shouldn't be committing your vendor
directories. It only ignores the instances of the dependencies you have locally installed in your system; only so that when you commit the codebase to AppEngine, it triggers to create its own set of dependencies. In that process, the vendor
directories should be recreated from the source, and you'd end up with the same system.
By default, the vendor/ directory is ignored in the generated .gcloudignore file to reduce the number of files sent in deployment.
So for clarity, the local dependencies don't get transferred but essentially get recreated by AppEngine.
Google bundles vendor dependencies directly in the gcs plugin so it's preventing itself from working.
Ignoring vendor/ is a problem since there are plugins that use composer to bundle libraries.
You can install plugins through Composer package; although not every plugin is available. You can check on Packagist, if the plugin is available as a Composer package. You also need to make sure that the plugin is listed properly in the composer.json
. Unfortunately, though there isn't a ready-made package for this plugin yet, but there are packages for other GCS plugins that accomplish the same thing. If you're set on using this particular plugin though, there are a few workarounds for installing plugins that aren't packaged yet, such as https://stackoverflow.com/questions/16847994/how-do-you-get-composer-to-install-a-non-composer-package.
Hope that helped! 🤙
from wordpress-plugins.
For me, the following worked for a GCE image (via GCP marketplace):
ssh into the image, using console
sudo apt-get install git
cd ~
git clone https://github.com/GoogleCloudPlatform/wordpress-plugins.git
cd wordpress-plugins/gcs-media-plugin
sudo apt-get install composer
composer install
cd ~
sudo cp -r wordpress-plugins/gcs-media-plugin /var/www/html/wp-content/plugins/
sudo chown -R www-data.www-data /var/www/html/wp-content/plugins/gcs-media-plugin
from wordpress-plugins.
Related Issues (20)
- Locally uploaded images does not have thumbnails in Media libraries HOT 2
- How to use Google Cloud Storage plugin only for uploading? Not reading tasks
- this plugin doesnt work with latest version of wordpress
- Asset path without get_current_blog_id
- Notice: Project ID not given and Warning: Authenticated using end user credentials from Google HOT 1
- For those of your having issues with activating the plugin... HOT 2
- No Option to override the default Cache-Control value
- Is it possible to use the plugin with permissions? HOT 1
- Storage URL has another digit and image does not load HOT 1
- Mail plugin not working
- [gcs-media-plugin] Unable to upload files when updating plugin to v0.1.5 HOT 13
- thumbnailing / image rescaling broken
- Domain-named bucket [GCS plugin]
- Google\Cloud\Storage\StreamWrapper::stream_metadata is not implemented HOT 2
- PHP Fatal error: Uncaught Google\Cloud\Core\Exception\ServiceException: cURL error 35: OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection HOT 2
- GCS plugin is very slow in admin media grid mode HOT 1
- iP
- Found a possible security concern
- I'm
- Q
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wordpress-plugins.