Support » Localhost Installs » Docker Curl(7): error; cannot access pages from dashboard

  • I have a WordPress docker container with mysql 5.7 set up for local development using docker-compose on mac.

    The problem is that I can’t access my pages through the dashboard. They are not editable there, and none are selectable as ‘static’ pages. The only page viewable is the ‘sample’ page.

    This is the error:
    The REST API request failed due to an error.
    Error: [] cURL error 7: Failed to connect to localhost port 8000: Connection refused

    I’ve tried adding
    define( ‘ALTERNATE_WP_CRON’, true );define( ‘WP_CRON_LOCK_TIMEOUT’, 1 );
    to the wp-config.php file, as per the instructions here:

    I have also tried adding new pages to the default themes as well. No luck.
    I deleted all plugins and custom themes at one point, as well.
    There also doesn’t seem to be anything wrong with the cron events being scheduled.

    I am able to update and view the theme I am creating through port:8000 and add plugins. However, none of my pages are viewable in the dashboard.

    Being pretty new to docker and wordpress, I’m hoping someone might have an answer or be able to shed some light on the situation.

    Here is my yml file:

    version: ‘3.3’

    image: mysql:5.7
    – db_data:/var/lib/mysql
    restart: always
    MYSQL_ROOT_PASSWORD: somewordpress
    MYSQL_DATABASE: wordpress
    MYSQL_USER: wordpress
    MYSQL_PASSWORD: wordpress

    – db
    image: wordpress:latest
    – ./wp-content:/var/www/html/wp-content
    – “8000:80”
    restart: always
    WORDPRESS_DB_HOST: db:3306
    WORDPRESS_DB_USER: wordpress
    WORDPRESS_DB_NAME: wordpress
    WP_DEBUG: 1

Viewing 5 replies - 1 through 5 (of 5 total)
  • Mac Users running WordPress locally must edit their httpd.conf file editing the AllowOverride line to read AllowOverride All in theDirectory “/Library/WebServer/Documents” host instructions. For Mac OS X 10.5.x and up this file is located in/private/etc/apache2/users/[your-username].conf, otherwise it is located at /etc/httpd/httpd.conf.

    do you read any denied rules?

    By denied rules, do you mean 400 errors? None in the console, none being logged by wordpress, none in the docker logs.

    I can’t find the httpd.conf file, or a directory. Docker might be organized differently.

    Instead, I looked at the apache2.conf file and found:
    <Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied

    <Directory /usr/share>
    AllowOverride None
    Require all granted

    <Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted

    I tried changing the AllowOverride to All.
    Didn’t work.

    I feel out of my depth here, but I’m wondering if the issue is how the containers work.
    Since its a container running on my Mac, I’m wondering if the problem is requests trying to reach the exposed virtual port 80 on the container through 8000 on my mac.

    Your error indicates that it was not possible to connect.
    Firewall block (on the port), proxy, Docker.
    Setting to ALL will then allow you to use Permalinks (then for WordPress).

    I see.
    After changing from ‘none’ to ‘all’, same error, same issue.

    • This reply was modified 1 month, 3 weeks ago by jonpaul1.

    Hey @autotutorial,
    Thanks for all your help!
    For the meantime I’ve gone back to MAMP. I’ll revisit this in the future when I have some time to play around with it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.