Changing from VHOST declaration in wp-config
-
Bear with, this is a bit long but I wanted to try and get all relevant info in.
At work, I inherited a pretty old networked install of wordpress and while testing the upgrade to PHP 8 get the following notice:
Deprecated: Function define() was called with an argument that is deprecated since version 3.0.0! The constant VHOST is deprecated. Use the boolean constant SUBDOMAIN_INSTALL in wp-config.php to enable a subdomain configuration. Use is_subdomain_install() to check whether a subdomain configuration is enabled. in /public_html/wp-includes/functions.php on line 6031
I know things still work now but I have read this would be fatal error in later versions of PHP so ideally I’d like to resolve before things break.
It’s using the latest version of wp core and all our plugins etc are up to date. It is a sub directory setup.
I think the VHOST line is an old way of doing the network install? On our dev server I tried replacingdefine('VHOST', 'no');
in the wp config with the following:define('WP_ALLOW_MULTISITE', true);
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );I also had to add
define('WP_ALLOW_REPAIR', true);
Once it had gone through the db repair, I got the following:
wp_posts: Table 'wp_posts' doesn't exist
wp_comments: Table 'wp_comments' doesn't exist
wp_links: Table 'wp_links' doesn't exist
wp_options: Table 'wp_options' doesn't exist
wp_postmeta: Table 'wp_postmeta' doesn't exist
wp_terms: Table 'wp_terms' doesn't exist
wp_term_taxonomy: Table 'wp_term_taxonomy' doesn't exist
wp_term_relationships: Table 'wp_term_relationships' doesn't exist
wp_termmeta: Table 'wp_termmeta' doesn't exist
wp_commentmeta: Table 'wp_commentmeta' doesn't existI think these tables do actually exist but with the prefix
wp_1_
instead – based on the fact the content in the the top level/root site is in these tables.Would I be right in thinking we could rename those tables to correct the setup? What are the implications of doing this? Is there a better option instead?
We also have the line
define('BLOGID_CURRENT_SITE', '1' );
in the wp config for this network. On other ones I’ve seen the 1 is not in quotes. Is that something we should also change or can we ignore?We don’t have proper in-house wordpress support (I come from a design background) and while I have access to DbA’s they don’t know wordpress-specific stuff so any thoughts or suggestions very much welcome.
- You must be logged in to reply to this topic.