westerfunk
Forum Replies Created
-
Forum: Plugins
In reply to: [The Events Calendar] Error on updatingSame here, same error.
Forum: Fixing WordPress
In reply to: Fatal error: Out of memory (allocated 30408704)On 1and1 host myself … after getting this error and troubleshooting for a while, what finally worked was disabling all of my plugins, I ran the upgrade, and it worked.
Forum: Fixing WordPress
In reply to: WordPress Behind Reverse Proxy?DO THIS AT YOUR OWN RISK!
BACK UP ALL YOUR FILES BEFORE YOU START MANUALLY EDITING THE CODE!
I have a solution that works, but it requires some extra code. It differentiates between a web client hitting the web server directly (as in most hosting situations) or hitting the web server through a reverse proxy. I wrote this code a year ago for another site I own that runs behind an Apache reverse proxy I run at home.
I took this code and then added it to a my-hacks.php file I created in the WordPress root directory. Then, I went into the WP-Admin and turned on the my-hacks.php legacy functionality under Settings, Miscellaneous.
Here’s the code:
<?php function writeIPAddress() { if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) == '') { return $_SERVER['REMOTE_ADDR']; } else { return $_SERVER['HTTP_X_FORWARDED_FOR']; } } ?>
Then I took the function “writeIPAddress()” specified above and replaced every instance of “$_SERVER[‘REMOTE_ADDR’]” in each PHP file where an IP address is either called for or displayed (such as “comment.php” under the wp-includes folder). Let me know how this works for you.
——————————————–UPDATE:
I should refine this a bit further … the only file I had to update was comment.php and there was only one place in the code where I replaced the function.