• Hello,
    I have developed my wordpress locally. I am running 2 docker containers one with wordpress one with mysql. I start the contianers with a yaml file as seen below:

    version: "3"
    # Defines which compose version to use
    services:
      # Services line define which Docker images to run. In this case, it will be MySQL server and WordPress image.
      db:
        image: mysql:5.7
        # image: mysql:5.7 indicates the MySQL database container image from Docker Hub used in this installation.
        restart: always
        environment:
          "MYSQL_ROOT_PASSWORD":
          "MYSQL_DATABASE":
          "MYSQL_USER":
          "MYSQL_PASSWORD": # Previous four lines define the main variables needed for the MySQL container to work: database, database username, database user password, and the MySQL root password.
      wordpress:
        depends_on:
          - db
        image: wordpress:latest
        restart: always
        # Restart line controls the restart mode, meaning if the container stops running for any reason, it will restart the process immediately.
        ports:
          - "8000:80"
          # The previous line defines the port that the WordPress container will use. After successful installation, the full path will look like this: https://localhost:8000
        environment:
          "WORDPRESS_DB_HOST":
          "WORDPRESS_DB_USER":
          "WORDPRESS_DB_PASSWORD":
          "WORDPRESS_DB_NAME": # Similar to MySQL image variables, the last four lines define the main variables needed for the WordPress container to work properly with the MySQL container.
        volumes: [ "./:/var/www/html" ]
    volumes:
      mysql: {}

    I have my credentials saved in a .env file and have all my code in a repository on github.
    The website is working locally.
    I took the following steps to migrate the local installation to the server.
    1. I have cloned the repo and manually created the .env file on the server and then started the containers with “docker-compose up -d”
    2. I have copied my local sql dump and imported it to the mysql database on the server
    3. When I tried to access the site over the servers url I got a message about wpforms_lite “Plugin could not be activated because it triggered a fatal error.”
    4. I deactivated all the plugins through the SQL DB and then was able to access the admin panel.

    Now the plugins page reads the following error:

    Warning: require_once(/var/www/html/wp-content/plugins/wpforms-lite/vendor/woocommerce/action-scheduler/action-scheduler.php): 
    Failed to open stream: No such file or directory in /var/www/html/wp-content/plugins/wpforms-lite/src/WPForms.php on line 214 Fatal error: 
    Uncaught Error: Failed opening required '/var/www/html/wp-content/plugins/wpforms-lite/vendor/woocommerce/action-scheduler/action-scheduler.php' (include_path='.:/usr/local/lib/php') in /var/www/html/wp-content/plugins/wpforms-lite/src/WPForms.php:214 
    Stack trace: #0 /var/www/html/wp-content/plugins/wpforms-lite/src/WPForms.php(173): WPForms\WPForms->includes_magic() 
    #1 /var/www/html/wp-content/plugins/wpforms-lite/src/WPForms.php(125): WPForms\WPForms->includes() 
    #2 /var/www/html/wp-content/plugins/wpforms-lite/src/WPForms.php(408): WPForms\WPForms::instance() 
    #3 /var/www/html/wp-content/plugins/wpforms-lite/wpforms.php(285): wpforms() 
    #4 /var/www/html/wp-admin/includes/plugin.php(2318): include_once('/var/www/html/w...') 
    #5 /var/www/html/wp-admin/plugins.php(192): plugin_sandbox_scrape('wpforms-lite/wp...') 
    #6 {main} thrown in /var/www/html/wp-content/plugins/wpforms-lite/src/WPForms.php on line 214 

    Several other plugins throw a very similar error. Where did I go wrong in my migration process? I am assuming reinstalling the plugins would fix the error but I do not want to lose my data connected to these plugins. I also don’t want to run into the issue again in my next deployment so I am hoping someone more experienced could help me in my deployment strategy.

    Thank you in advance.

    • This topic was modified 1 year, 7 months ago by forcio.
    • This topic was modified 1 year, 7 months ago by forcio.
    • This topic was modified 1 year, 7 months ago by forcio.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Is there anything in your Docker config or deployment process that installs the plugin files on the server? For example, a composer.json lists the plugins to install, and Docker runs composer update .

    How did you install the plugins in your local install?

    Thread Starter forcio

    (@forcio)

    Hi Ian,
    I installed the plugins over the wordpress admin portal on my local machine. Do you thing creadting a “composer.json” at the current stage would fix the issue and install the plugins in the container with “composer update”?

    Yeah, you’ll need some kind of process to make sure the files exist on the server you’re deploying to. Installing via the admin panel only installs the files on the current server.

    Composer is one option. You could also use WP-CLI, or you could just manually install the plugins via the admin panel on the server. That shouldn’t delete any data, unless the plugin is written in an unconventional way.

    There are some projects like https://roots.io/bedrock/ and https://sailed.io/ that may be easier to use that creating your own system from scratch. Or, may at least provide some examples and inspiration.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Plugin fatal error after migration.’ is closed to new replies.