wckr / wocker

Create your WordPress development environment in 3 SECONDS!
https://wocker.dev/
MIT License
480 stars 42 forks source link

Installing PHP modules #84

Closed andrewtcymmer closed 5 years ago

andrewtcymmer commented 5 years ago

I am using Wocker to try out using a theme and plugin that my company bought for a client, that also requires the PHP Zip module to be installed. Running inside the Wocker environment, The theme is giving an error message when trying to access the Tools section (in wp-admin) that says Oops, Unyson Backup requires PHP Zip module but it is not enabled on your server. If you are not familiar with PHP Zip module, please contact your hosting provider.

I have been able to shell into the vagrant box's docker container to install Pear and try to install the zip module. I have so far been unsuccessful, but I thought I'd reach out and ask if there is a recommended way to configure php extensions through the Vagrantfile in this repo? Apologies if this question doesn't make sense due to my unfamiliarity with Vagrant.

ixkaito commented 5 years ago

@andrewtcymmer Thank you for using Wocker.

if there is a recommended way to configure php extensions through the Vagrantfile in this repo?

To configure PHP extensions, you have to customize the Dockerfile. It requires knowledge of Docker.

I tried adding php7.0-zip. Could you test it and tell me the result?

  1. Make sure your VM is running. If not:
    $ vagrant up
  2. SSH into the machine:
    $ vagrant ssh
  3. Make sure no container is running. If not:
    wocker ~ $ wocker stop
  4. Run a container (e.g. zip-test) using wocker/wocker:zip image
    wocker ~ $ wocker run --name zip-test wocker/wocker:zip

    This will pull the wocker/wocker:zip image from Docker Hub automatically.

  5. Test if your theme and plugin work.
andrewtcymmer commented 5 years ago

@ixkaito I have verified that the docker image wocker/wocker:zip is working correctly with my theme and plugin. Thank you for your prompt and accurate response.

ixkaito commented 5 years ago

@andrewtcymmer I added the PHP zip module to the official Wocker image on v1.4. After wocker update, you can just wocker run without wocker/wocker:zip to test your plugin.