Solve 404 Error When Activating Plugin In WordPress

Today i found a weird issue when trying to activate a WordPress plugin. I always redirected to 404 Error Page (Not Found). This is the first time i met this error. In most case it is crash problem or PHP Fatal error, which is easily to fix. I tried to debug the Apache error log, Nginx error log and MySQL log. There were no error related to the issue.

After doing debug for hours, i finally found the issue. It was a very slow query which is lead to exceed PHP max execution time. There are 3 queries to the database which is alter the wp_posts that take more than 100 seconds to finished. I found this when i activated mysql slow query log. So to fix the issue, i comment that 3 lines and manually update the database table from PHPMyAdmin. Then i try to activate the plugins.

Now the plugin work perfectly. So if you having the similar issue, please check that plugin’s code at wp_activation_hook function. And find if there is a code or database query that will take forever to finished. Hope my experience could help you all.


  1. Scarletbluestocking says:

    Hi Ivan.

    I have encountered the same 404 error on my newly installed WordPress site. My web host uses an Nginx + PHP-FPM server. Because I am new to web development, I asked my web host to fix the issue for me, which he did swiftly.

    It is my intuition that led me to choose Nginx over the tried and tested Apache. I thought it would be better to learn WordPress design using Nginx because it is faster, and lighter.

    My dilemma at the moment is that, I want to learn, Php, CSS, and Ajax using Dreamweaver CS5 for my WordPress site. There are available resources to do this using WAMP and XAMPP, but I searched to no avail for a similar WEMP ( Windows, Nginx, Mysql, Php) that is encouraging enough to set-up for a newbie like me.

    Please help me figure out a possible game plan for my dream website. I want to dive in to content (which I can do far more better), but I want to secure my site infrastructure first.

    It has been a long and tedious day, and some blogs I asked for help either completely ignored me or deleted my query. Geeks could be busy snobs sometimes.

    Thanks and more power.

Give me your feedback

This site uses Akismet to reduce spam. Learn how your comment data is processed.