Link to home
Start Free TrialLog in
Avatar of Matthew B
Matthew BFlag for Canada

asked on

Urgent: WordPress some pages showing 500 error, others not!

Friend transferred a wordpress site to a new VPS, the new host is displaying SOME pages but not all pages.

For example /category/mypage works
but category/mypage2 returns 500 server error

Wp-admin works, so i dont htink its a database issue, i re created the htaccess file, no luck.

When i inspect the  broken page it says <!-- html is corrupted -->

They are using the wordpress fastest cache plugin, not sure if that helps (even though i look into the cache folder and not all the pages are in here? is it permissions? i set 777 temporarily on those folders but look slike Fastest Cache isnt loading those pages into the cache)


Any ideas other than corrupted pages one one page would return 500 server error?
Avatar of Kimputer
Kimputer

Most probably indeed the cache plugin, so try to disable the plugin (just to test those error pages), and also try the full delete cache function, if it solves your problem or not.
Avatar of Matthew B

ASKER

Tried this.

No luck, still 500 error on thise pages.

Can we totally rule out database bc wp admin works ?
You can rule it out, only if that page shows up correctly in the wp-admin pages.
To know the exact problem, simply enable WP_DEBUG in your wp-config.php file + likely the resulting debug.log data will be sufficient to fix the problem.

If this is insufficient, you may have to refer to your Apache or PHP FPM logs.
So weird we found issue was xml for php wasnt enabled. Didnt find any reference to this in apache logs or wp debug logs.

Would wp debug logs show php errors? Assume i would see an error in relation to the missing package but i didnt
When you have WP_DEBUG enabled, you should have seen some indication your XML couldn't be processed.

Look through your WordPress debug.log file carefully + you'll likely find something.

Keep in mind at the PHP-7.0 point, many modules moved out of PHP core into separate modules including - XML + MBstring + several others.

All these modules must be installed now, to provide all features core use to provide.
Hi,

Maybe for some reason it's just your .htaccess file in your public_html (or private_html in case of ssl).

Make a copy of your current .htaccess file to let's say .htaccess2.
Then in Wordpress go to 'Settings' --> 'Permalinks' and click 'save'. This will create a new .htaccess file.

After that try again.

Cheers.
Hi,

I think I missread, you already recreated the .htaccess.

Cheers
Hi all sorry the answer was the dev that did the transfer neglected to tell me that a plugin used php-xml extension. i never saw any mention in the errors about this.
Hi,

thanks for the update and glad it's solved!

Happy to help here.

Cheers
ASKER CERTIFIED SOLUTION
Avatar of Matthew B
Matthew B
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
In the future, just glance at your WordPress debug log or Apache logs + you'll be able to determine root cause of any 500 error quickly.
Hi DAvid,

whats weird is i did do that.

And it Showed an error with the plugin but nothing referencing a missing php extension :(
The clue will be in the exact message generated... well... usually this is true...

Likely the plugin called some function which died, because the function wasn't defined.

Then you'll just lookup the function, which many times will relate to a missing extension.

Tip: This is common going from PHP-5.x -> PHP-7.x because many core functions were moved out of core into extensions.

Tip: Extensions are very small. When I setup a new LXD container install, I generally install most PHP extensions.

Tip: Avoid installing php-xdebug, if you're using PHP-7.3 along with MySQL/MariaDB, as a bug exists in XDebug which will cause all database transactions to die. Super annoying + takes forever to figure out.

Wait till XDebug-2.7 releases (full/real PHP-7.3 support) to install the php-xdebug extension.