Git Product home page Git Product logo

Comments (10)

sebastianbk avatar sebastianbk commented on June 13, 2024 3

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.

image

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.

sebastianbk avatar sebastianbk commented on June 13, 2024 3

@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.

sebastianbk avatar sebastianbk commented on June 13, 2024 1

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.

DeanMarkTaylor avatar DeanMarkTaylor commented on June 13, 2024 1

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.

Zertz avatar Zertz commented on June 13, 2024 1

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.

FrankM1 avatar FrankM1 commented on June 13, 2024 1

Ignoring vendor/ is a problem since there are plugins that use composer to bundle libraries. This means those too will malfunction.

from wordpress-plugins.

FrankM1 avatar FrankM1 commented on June 13, 2024 1

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.

ran-dall avatar ran-dall commented on June 13, 2024

@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.

ran-dall avatar ran-dall commented on June 13, 2024

@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.


@Zertz

Google bundles vendor dependencies directly in the gcs plugin so it's preventing itself from working.

@FrankM1

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.

wsnel avatar wsnel commented on June 13, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.