installing wordpress with docker on centos7

I am installing wordpress with docker on centos7 linux OS.I have installed mysql container successfully and got an error when i wanted to install wordpress container showing "docker:Error response from daemon:driver failed programming external connectivity on endpoint :Error starting userland proxy:bind address already in use.Please find attached the snapshot of my error page and the snapshot showing my http ports(80 & 443)
Category: Web

New wordpress keep redirecting to localhost/wp-admin/install.php

IN my fresh wordpress install via docker. Everytime i hit localhost it gets redirected to http://localhost/wp-admin/install.php Now its missing the wp , the url should be http://localhost/wp/wp-admin/install.php My Env variable is like this WP_ENV=development WP_HOME=http://localhost/wp WP_SITEURL=${WP_HOME}/wp my apache vhost file is <VirtualHost *:80> ServerName http://localhost DocumentRoot ${APACHE_DOCUMENT_ROOT} <Directory ${APACHE_DOCUMENT_ROOT}> AllowOverride all </Directory> CustomLog /var/log/apache2/local-access.log "combined" ErrorLog /var/log/apache2/local-error.log </VirtualHost>
Category: Web

WordPress Permissions on my Local with Docker

I'm using docker and docker compose to install WordPress on my localhost and everything is working fine however i'm having problems when uploading new media and installing themes, new plugins e.t.c. The message "Could not create directory" appears when i want to install a new plugin. With extensive research i have tried many options to fix the file/folder permissions, even with a chmod 777 and still with no success. My docker compose file is: wordpress: container_name: testing image: wordpress environment: …
Category: Web

Why is my child theme style.css not found (404) in the front-end?

I have a brand new Wordpress install (5.9.3) served by nginx (1.13.12). I'm using Docker containers for nginx and wordpress. I created a child theme based on twentytwentytwo following the WP codex instructions. It shows in the wp-admin and I was able to activate it and customize it through the block Editor. Now I want to add a css class to my style.css. Here's the function to enqueue my child-theme's styles : add_action( 'wp_enqueue_scripts', 'chesnaie_styles' ); function chesnaie_styles() { $parenthandle …
Category: Web

How to update wp-config file in Docker

I am trying to change our blogs from Wordpress to inside a docker container, so that we can move around it easily. I wrote a docker-compose file for the purpose and it ran smoothly the first time. But I made some mistakes on configs and missed to write the HOME and SITEURL on the docker-compose file in the beginning. Now, I can't seem to change the wp-config.php. according to Wordpress, it can't be updated from the entrypoint script once it's …
Category: Web

Configuring Xdebug with docker compose

I'm trying to configure a WordPress development environment with docker-compose and Xdebug but I can't get the debugger to work with a simple break point on info.php file after starting my debugging session on vscode. here are my configs: rootDir/.vscode/launch.json { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Listen for Xdebug", "type": "php", "request": "launch", "port": 9003, "pathMappings": { …
Category: Web

WordPress REST API not working on localhost

I have a WordPress site running WordPress 5.9.3 that is using a React-based theme, which uses the REST API (v1), to retrieve content and menus from the standard WordPress CMS back-end. However, when trying to install it locally, I can't get the API to work and retrieve the needed data. I'm using a Docker environment based off this repo: https://github.com/kassambara/wordpress-docker-compose Since the theme uses React and the REST API to get the site content, trying to view the site gets …
Category: Web

Duplicator Pro plugin with Docker on local?

I have the Duplicator Pro plugin. In the past it was fairly easy to use. I have a wordpress site on a server, I'm trying to bring it down/migrate it down into a local sandbox. I have my local wordpress instance setup with Docker. Spinning it up initially with Docker was very easy and was tired of the clunky MAMP/WAMP tools. However migrating the site down while using Docker locally has been a challenge. With the Duplicator pro plugin the …
Category: Web

How and where are the provisioning script set up in Wordpress?

How and where are the provisioning script set up in Wordpress? I need to dockerize an application, the issue is after putting the wp_content folder, I noticed the database wasn't provisioned yet (meaning the tables weren't created and the tables weren't populated), so I am thinking there might be some shell script, native scripts and provisioning scripts that didn't run and I am trying to find where they are. Is there a native provisioning system set up already? If so …
Category: Web

Too many redirects error when change of base url

recently I got to manage a Wordpress blog (so I don't know of things made before) and to start doing some edits on it I did a local docker compose as sandbox. When I copied the contents (Wordpress files + mysql db), the website worked well, instead for the links that didn't redirect to the local version but to the production one. So, to make them work (as I am unable to access to administration), I replaced in wp_options table …
Category: Web

wp-admin remove part of the url

This looks like wp-admin remove the subfolder URL but it's not the same problem, because the subfolder part is not a subfolder. I'm working on a clean VM as a host for Docker containers. I have a dockerized Wordpress listening on 8080 on the VM. I can hit Wordpress at http://<vm_ip>:8080 and install just fine. It takes me to the backend at http://<vm_ip>:8080/wp-admin/ and everything works as expected. Now I'd like to access my blog at http://<vm_ip>/blog/ so I set …
Category: Web

How to queue API requests with PHP in WordPress?

I'm developing a plugin to manage some simple custom APIs. I'd like to handle clients requests to APIs with a queue, so as not to handle all requests in parallel but one at a time, with a FIFO logic: when one request has been satisfied, the next one in the queue is processed and so on ... I tried to use the Pheanstalk library but the server responds with error 500, as a development environment I am using Devilbox, how …
Category: Web

wordpress in nginx docker container connected to php:8-fpm container and mariadb container isn't creating any tables on plugin activation

I searched the whole net and stackexchange for a reason and a solution, but couldn't find any. There are many questions (and answers) related to own plugins and the code how to create tables on activation. But this applies not here, because I have this problem with well known and maintained plugins from the wordpress plugin repository. So, the situation: A kvm guest with around 20 docker stacks. Each stack consists of a nginx, a php:8-fpm and a mariadb container. …
Category: Web

Using docker with wordpress, how to handle backups correctly?

I am planning on self-hosting my wordpress on server using docker. When using the official docker image with wordpress, how should I be handling my backups? I will need to make sure my database has a volume where I can then backup the mysql database. What about the filesystem to make sure my attachments are backed up? Anything else to consider?
Category: Web

ERROR: No such service: nginx when building wordpress with docker

I am having an issue in which after the installation of wordpress and the creation of the user with login I am getting a wp error: One or more database tables are unavailable. The database may need to be repaired. and is asking to add the following code to the wp-config.php. define('WP_ALLOW_REPAIR', true); I have added this code as asked but is not working. In addition, I am also adding the error: ERROR: No such service: nginx DUMP FILE BEFORE: …
Category: Web

Wordpress docker with empty responses to HTTP requests

I originally posted this on Stack Overflow but felt it would be better here. I've got a Wordpress docker container that isn't really responding. Trying to access it from the browser results in an empty page. No 404 or anything. Trying curl from either a computer on the network, or the server itself returns an empty response as well. I've done a docker exec -ti container bash into it to try and run curl from within, and it's also empty. …
Category: Web

Docker compose with wordpress:cli-php7.4 stalls on 'The site you have requested is not installed'?

I have the following docker-compose.yml file where i'm using the wordpress:cli-php7.4 to get the core wordpress and wp-cli image. version: '3' services: wordpress: depends_on: - db image: wordpress:cli-php7.4 restart: always environment: WORDPRESS_DB_HOST: db:3306 WORDPRESS_DB_USER: wordpress WORDPRESS_DB_PASSWORD: wordpress WORDPRESS_DB_NAME: wordpress volumes: - /home/dc-user/github/wordpress:/var/www/html ports: - 8080:80 networks: - back db: image: mysql:5.7 restart: always volumes: - db_data:/var/lib/mysql environment: MYSQL_ROOT_PASSWORD: somewordpress MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress networks: - back phpmyadmin: depends_on: - db image: phpmyadmin/phpmyadmin restart: always ports: - 8001:80 environment: …
Category: Web

Wordpress /wp-admin redirect to wrong port in docker

While installing an existing Wordpress installation in a docker container, I've been unable to access the wp-admin pages. The site and pages load perfectly but when browsing to https://example.com/wp-admin that url is redirected to http://example.com:8080/wp-admin and is unable to load since nothing is hosted on that port (note the http/https). The Wordpress site is copied into the docker image that is then executed on google cloud run. Cloud run redirects port 80 to 443. I've already tried setting the WP_SITEURL …
Category: Web

WordPress docker page is missing VIRTUAL_HOST variable

According to many tutorials about WordPress & Docker, VIRTUAL_HOST is one variable of WordPress environment variables, but there is no mention of it in the offcial WordPress page in hub.docker.com, and if this variable is not mentioned, I think it may be the case for other variables. I've searched the web a lot for such documentation but I didn't find, and this is my question, Where can I find that documentation of VIRTUAL_HOST and other docker WordPress environment variables?
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.