Varying-Vagrant-Vagrants / VVV

An open source Vagrant configuration for developing with WordPress
https://varyingvagrantvagrants.org
MIT License
4.54k stars 847 forks source link

Q: config.yml: Inject PHP settings into wp-config.php? #2744

Open mcyzyk opened 1 week ago

mcyzyk commented 1 week ago

Hi! I have a massive 30+ GB WP Multisite backup that I'm trying to Restore into VVV (using the really handy WP All-In-One Migration plugin) and no matter what I do the Restore of the database stops at exactly 91 percent.

I'm thinking something is timing out somewhere.

And so, I've put the following in my VVV config.yml:

custom: wp_type: subdirectory wpconfig_constants: WP_DEBUG: true WP_DEBUG_LOG: true WP_MEMORY_LIMIT: 1750M WP_MAX_MEMORY_LIMIT: 1750M WP_SET_TIME_LIMIT: 9999 WP_MAX_EXECUTION_TIME: 9999

From what I'm reading, I should be able to inject PHP config overrides this way, via VVV config.yml into wp-config.php, no?

Once I have my Site up, I go to check its environment and it says "php80" and overrides nowhere to be found.

(I am trying to initially Restore into a php74 server so I can see what happens when I upgrade to php80. Our SysAdmin did this in Production last spring and there were exceptions thrown. I'm now trying to figure out what those were, but in a development environment.)

How can I inject PHP configuration overrides via my config.yml file?

How can I force php74 via my config.yml file?

Thanks,

Mark

tomjn commented 1 week ago

@mcyzyk looks like the formatting of the config snippet got mangled as it wasn't in a code block, however:

But importantly:

WP_MAX_MEMORY_LIMIT: 1750M

1.7GB is HUGE, and it should not be necessary. Additionally for a 30GB import you should not be using the browser, you should be using WP CLI or connecting directly to the database to do it. I would also note that your VM is only so big, if you don't have the allocated disk space it will get full, and you can't ask for 8GB if there's only 4GB of ram in the VM etc

tomjn commented 1 week ago

I should also say, memory and time limits shouldn't apply to PHP CLI

mcyzyk commented 1 week ago

So useful!

Wondering how to do this:

"If you don't tell VVV to install PHP 7.4 it won't use it even if you correctly specify that's what you want a site to use"

Searching...

tomjn commented 1 week ago

"If you don't tell VVV to install PHP 7.4 it won't use it even if you correctly specify that's what you want a site to use"

It's in the official docs under changing PHP: https://varyingvagrantvagrants.org/docs/en-US/adding-a-new-site/changing-php-version/

VVV
Changing PHP Version
VVV supports the php option in the sites section of config/config.yml to set the PHP version.