I'm running a website at http://localhost:8080/sitename
. However, when I'm trying to create a network of sites with wordpress, I'm getting the following error under Tools-> Network
:
ERROR: You cannot install a network of sites with your server address.
You cannot use port numbers such as :8080.
I tried to create a virtual host and a fake domain but I can't make it work. How can I solve that?
Disadvantages of Multisite The things that make Multisite a great sharer also contribute to its flaws. Migrations are exceedingly complex as each site shares one database. Migrating one site off your network is very difficult. You cannot truly separate users; each one will still have access to the entire network.
At this moment, Wordpress only seem to support 80 and 443 ports. A temporary possible workaround to use any custom (i.e. http 8080
) port:
Open wp-admin/includes/network.php
and find the section of code where it mentions array( ':80', ':443' )
and add :8080
too in that array.
After completing setup of network, you might need in wp-config
to adjust to such:define( 'DOMAIN_CURRENT_SITE', 'example.com'. (stristr($_SERVER['PHP_SELF'],'wp-login.php') ? '':':8080') );
As noted in comments (thanks) after creating first sub-site, it might have port number embedded in domain name, so try to enter Mysql Database (i.e. try hosting's phpMyAdmin, or even installed plugin before starting procedure) and in _blogs
& _site
& _options
tables, to adjust homepage urls of subsites(i.e. separate port number from domain).
That's all. Login again to your project.
From my experience, WP is not designed to use custom ports for multi-sites so the blogs (sub-sites) hosts get messed up in the DB.
My solution: After you switch to multi-site or create a new site, you need to go to your db admin page (e.g. phpMyAdmin) and fix the blogs domain in the wp_blogs
table. Basically WP failed to add a colon between the host and port; just have to add it-> localhost8080 becomes localhost:8080.
So, on the site's settings add the missing colon to the siteurl and home urls.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With