dslk6326846 2019-01-28 14:52
浏览 78
已采纳

在docker上安装duplicator archive以进行本地wordpress开发

I have a live website, and I want to test something locally. With Duplicator I made a installer and locally I started a Docker Container for Wordpress. This is my docker-compose.yml:

version: "2"
services:
  my-wpdb:
    image: mariadb
    ports:
      - "8081:3306"
    environment:
      MYSQL_ROOT_PASSWORD: password
  my-wp:
    image: wordpress
    volumes:
      - ./:/var/www/html
    ports:
      - "8080:80"
    links:
      - my-wpdb:mysql
    environment:
      WORDPRESS_DB_PASSWORD: password

I copied the installer.php in the local folder and started the installation on localhost:8080/installer.php.

When I reach the page for the database connection it doesn't work, and I don't understand if what I want to achieve is not possible or I make some mistakes.

This is what I see:

And this is what I can read on dup-installer-log.txt:

INSTALLER ERROR:
*** PHP Fatal Error Message: Uncaught Error: Call to a member function options() on boolean in /var/www/html/dup-installer/classes/class.db.php:45
Stack trace:
#0 /var/www/html/dup-installer/ctrls/ctrl.s2.dbtest.php(162): DUPX_DB::connect('localhost', 'admin', 'password', NULL, '8081')
#1 /var/www/html/dup-installer/ctrls/ctrl.s2.dbtest.php(121): DUPX_DBTest->r10All(Array)
#2 /var/www/html/dup-installer/ctrls/ctrl.s2.dbtest.php(87): DUPX_DBTest->runBasic()
#3 /var/www/html/dup-installer/ctrls/ctrl.s2.base.php(92): DUPX_DBTest->run()
#4 /var/www/html/dup-installer/main.installer.php(196): require_once('/var/www/html/d...')
#5 {main}
  thrown (Code: 1, line 45 in /var/www/html/dup-installer/classes/class.db.php)

Can somebody help me?

  • 写回答

2条回答 默认 最新

  • duankan6894 2019-05-07 17:54
    关注

    According to your file. it should be

    Host: my-wpdb Database: mysql User: root password: password

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?