Wordpress multisite setup Error

#1
We have been having issues in multisite setup on cloud Docker ols/ wordpress installation:
1) Wp config files that I tried
# BEGIN WordPress Multisite
# Using subfolder network type: https://wordpress.org/documentation/article/htaccess/#multisite

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

# END WordPress Multisite

____________
Error given :

wp_1_posts: Table 'wordpress.wp_1_posts' doesn't exist
wp_1_comments: Table 'wordpress.wp_1_comments' doesn't exist
wp_1_links: Table 'wordpress.wp_1_links' doesn't exist
wp_1_options: Table 'wordpress.wp_1_options' doesn't exist
wp_1_postmeta: Table 'wordpress.wp_1_postmeta' doesn't exist
wp_1_terms: Table 'wordpress.wp_1_terms' doesn't exist
wp_1_term_taxonomy: Table 'wordpress.wp_1_term_taxonomy' doesn't exist
wp_1_term_relationships: Table 'wordpress.wp_1_term_relationships' doesn't exist
wp_1_termmeta: Table 'wordpress.wp_1_termmeta' doesn't exist
wp_1_commentmeta: Table 'wordpress.wp_1_commentmeta' doesn't exist

__________________
Second configuration that I tried :

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^/ - [L]
RewriteRule ^/([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^/([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
______________

The same error persisted. it seems that the database is not propagating it. Can you please help us set up a multisite setup?
root@wprdress:~/oldwo/ols-docker-env/sites/wp.mrsoftwares.in/html# docker network inspect ols-docker-env_default
[
{
"Name": "ols-docker-env_default",
"Id": "af07d64cc6841b3ae273772a315d590593530c77c5929bc0bc9d4f09870c45e1",
"Created": "2024-06-22T16:32:35.895784048+05:30",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.31.0.0/16",
"Gateway": "172.31.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"25c038c4dde6807b4a61b18bf756edd931a9da1d3c0948c04760075d29abc15e": {
"Name": "ols-docker-env-redis-1",
"EndpointID": "2d4d3582fab9fe7f39635599e0840bde9f4eed8c724d12816ff02e7a98b96bd3",
"MacAddress": "02:42:ac:1f:00:02",
"IPv4Address": "172.31.0.2/16",
"IPv6Address": ""
},
"34893b03f5467d9c6c7959c3485df36261992e64ef2a6c8a31fceb869184568e": {
"Name": "maria",
"EndpointID": "f93103c1f724fcced7c7430de12acacf48bcd364458643de807741e78ff038e6",
"MacAddress": "02:42:ac:1f:00:05",
"IPv4Address": "172.31.0.5/16",
"IPv6Address": ""
},
"c731c4f5ab75c1012e86712bacb599f1773f34c35394237c3b59d85ea4a056ca": {
"Name": "ols-docker-env-phpmyadmin-1",
"EndpointID": "e6e8ad638280b9680c99f9a0c91acf9331dc708b92289c52f74279b8a4c1c671",
"MacAddress": "02:42:ac:1f:00:04",
"IPv4Address": "172.31.0.4/16",
"IPv6Address": ""
},
"df9294aa447d46a2e0043408414ef26027af8ce0831e45183bc85d82c673eae3": {
"Name": "litespeed",
"EndpointID": "2862c17f765dcc916c98729ae1fd78cc6e8a954fdac1fad9f798fddc3d140cc9",
"MacAddress": "02:42:ac:1f:00:03",
"IPv4Address": "172.31.0.3/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {
"com.docker.compose.network": "default",
"com.docker.compose.project": "ols-docker-env",
"com.docker.compose.version": "2.27.2"
}
}
]
 
#3
I agree with Cold-Egg. My first thought was as to whether or not you had enabled multisite in wp-config.php.

This same file, wp-config.php, will also contain the database username, host, port, password, database name, and database prefix.

I'm not exactly sure off the top of my head, how multisite tracks the prefixes (different prefixes for each site are needed with multisite when using the same database name across sites).

In the file, below the various KEY and SALT definitions, is a line that defines $table_prefix 'prefix_';.

According to the error logs, your database name must be 'wordpress' and the prefix it's trying to use is 'wp_1_' I believe? Does your $table_prefix show something else?

Also, was WordPress working fine before you enabled multisite? Did you add the rewrite rules at the same time as setting multisite to enabled? Did you change the $table_prefix in wp-config.php after you enabled multisite?

The rewrite rules shouldn't be affecting this. The error logs show that it's a database error and that those entries don't exist within the table.

You can check from your server's command line by first running the mariadb client with:
Code:
mariadb -u root -p
then enter the password for your mariadb root user. Once you're at the prompt you can run:
use wordpress; followed by show tables;. You should see a list of entries, which will be a lot more than my example here, but in your case it should look something like this:
Code:
| wp_1_posts                             |
| wp_1_term_relationships      |                            
| wp_1_term_taxonomy            |                            
| wp_1_termmeta                      |                            
| wp_1_terms                             |
Please let us know this information so we can better help you.

EDIT: corrected database name with 'use' comnand

EDIT2: you should be able to check this with phpmyadmin too. and to access the mariadb server, you'll have to install mariadb-client on the host and add -h $hostname. You can also directly load the database with -D. So based on your docker-compose file, you would run
Code:
mariadb -u root -D wordpress -h 172.31.0.1 -p
and then inside the mariadb client, show tables; (ctrl-D or typing exit will exit the client)
 
Last edited:
Top