Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get script '/var/www/html/index.php' not found error when server is restarted #487

Closed
liemdo opened this issue Apr 19, 2020 · 0 comments
Closed

Comments

@liemdo
Copy link

liemdo commented Apr 19, 2020

I can reproduce this issue locally.

Steps to reproduce:

  1. I installed the Wordpress into a subfolder using the Dockerfile:
FROM wordpress:latest
WORKDIR /var/www/html/blog

or docker-compose:

version: "3.3"

services:
  db:
    image: mysql:5.7
    volumes:
      - db_data:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: somewordpress
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress

  wordpress:
    working_dir: /var/www/html/blog/
    depends_on:
      - db
    image: wordpress:latest
    ports:
      - "80:80"
    restart: always
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
      WORDPRESS_DB_NAME: wordpress
volumes:
  db_data: {}
  1. After logging into the dashboard, set the Permalink Settings to Post name.
  2. Restart the container and access the article again. Now I get 404 error.

Screen Shot 2020-04-18 at 8 24 08 PM

Logs:
[Sun Apr 19 00:44:24.669972 2020] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.3.16 configured -- resuming normal operations
[Sun Apr 19 00:29:55.638019 2020] [php7:error] [pid 193] [client 2600:1900:2000:a5::2:0] script '/var/www/html/index.php' not found or unable to stat`

Workaround:

  • Change the Permalink Settings to Plain and then switch back to Post name. The article now can be accessed via the pretty link.
@liemdo liemdo changed the title Get script '/var/www/html/index.php' not found error when installing Wordpress using a subfolder Get script '/var/www/html/index.php' not found error when server is restarted Apr 19, 2020
@liemdo liemdo closed this as completed Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant