Installing and Activating Wordpress plugins crashes Wordpress

Hey there,

Installing or activating a plugin crashes wordpress on Chrome and Firefox. Activating the plugin the plugin on the ‘Add Plugins’ page immediately redirects to a ‘Unable to connect’ page.

I am using Trellis and Bedrock too and I’m not seeing anything in the error logs so a bit puzzled as to why this is happening.

I can activate the plugin on the standard plugins list page.

Any help would be much appreciated!

Hey @orzelda - my guess is that this is unrelated to Sage and you might need to look elsewhere to figure it out. Have you tried activating a different theme (like Twenty Seventeen) and seeing if the problem still happens? If it still happens, Sage isn’t the culprit.

The reason I popped it in here was I suspected because of Trellis and maybe something in the Vagrant file.

Actually this has nothing to do with Sage and still occurs on the pre-packaged WP themes.

I updated my question to reflect this.

1 Like

Gotcha. Thanks for updating the post. Unfortunately, I’m not familiar with Trellis–hopefully someone else will stop by who can help out on that front.

When you say you’re not seeing anything in the error logs, are you looking at both of the following locations?

/srv/www/[sitename]/logs/
/var/log/

If you haven’t done this already, try setting WP_DEBUG and WP_DEBUG_LOG to true in /site/config/environments/development.php (assuming you’re having this issue in development):

<?php
/** Development */
define('SAVEQUERIES', true);
define('WP_DEBUG', true);

if( ! defined( 'WP_DEBUG_LOG' ) ) {
	define( 'WP_DEBUG_LOG', true );
}

With WP_DEBUG_LOG on, you should find a debug.log log file in /site/web/app/ which might provide more details.

1 Like

I am not seeing any of those log folders.

Thanks for the code to turn the debug stuff on. Trellis had this ON by default and nothing has appeared anywhere to log errors.

This is what I am getting when Activating the plugin.

There are no VPNs running and the firewall in the Mac OS System Preferences has been turned off.

Thanks for all your help!

Does this happen with a specific plugin, or all plugins?

Every plugin I install and then activate crashes the whole thing. It’s dead weird!

I can install it, go to the list plugins page on WP and then activate it there fine, but I am wondering if it pointing to something that might be erroneous in my local development setup.

Actually, this gentleman had a similar problem, but I’ve been unable to fix my problem with his solution, which was to slightly amend the Vagrant file.

Might want to start off by migrating away from that .dev TLD

1 Like

Thanks man! That was a good start! It no longer crashes but now I get the following

Which is definitely different!

Now that you have a new error message, have you looked into it and all of the possible solutions? What have you tried so far?

So the internet (and this article: https://imwz.io/updating-trellis/) has recommended that I do this to the main.yml in trellis/group_vars/all/main.yml:

php_max_execution_time: 300
php_max_input_vars: 1000
php_memory_limit: 256M
php_post_max_size: 128M

I added this in done a Vagrant Reload and restarted yarn but to no avail. I still think this is the right thing to do but not sure as to the location of where I should be adding the above instructions.

Try vagrant reload --provision as a normal reload won’t update those php values.

2 Likes

Hi,

Thanks for the tip, I got a new error from doing this.

I hadn’t edited the file that contained this variable (/trellis/roles/php/templates/php.ini.j2)

So to get around it, I defined php_max_input_time: -1 in group_vars/all/main.yml.

This stopped the error and the vagrant reload --provision completed, but now the old error of
‘This link has expired’ has reappeared. Dang it.

php_max_execution_time should already be defined in /trellis/roles/php/defaults/main.yml

Can you run vagrant destroy && vagrant up and see if the problem still persists?

This won’t delete any files in wp-content but will wipe the DB, so if you need to back the DB up, first vagrant ssh into the machine and run wp db export from your /srv/www/<site_name>/current folder.

Then after running vagrant destroy && vagrant up first see if the problem persists before restoring the DB backup. If the problem doesn’t persist, vagrant ssh into the machine and run wp db import <file> from /srv/www/<site_name>/current

1 Like

php_max_execution_time was indeed defined in /trellis/roles/php/defaults/main.yml but I think it was php_max_input_time I had the problem with. Anyway, it seems to be fixed!

Tried what you suggested re: vagrant destroy && vagrant up but the problem still persists. Hmmmm.

Thanks for all your help though!