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?
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 mentionsarray( ':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.
I found temporary solution:
running “netstat -o -n -a | findstr 0.0.80” in CMD will show you wich service is using the port 80. If PID is 4 it means that port 80 is used by the system (propably IIS or web matrix if it is installed – this was my case). i changed the port IIS was using from IIS Manager and i also deactivated MsDepSvc service (Web Matrix) which was also using port 80. After that i reconfigured apache to work in port 80 and everything worked OK!