More Fun with php.ini: Allow WordPress Plugin to Access Data On Remote Server

More Fun with php.ini: Allow WordPress Plugin to Access Data On Remote Server

Have you ever found that a WordPress plugin that works fine on one web host isn’t working as you would have expected when you move it to a new webhost? We recently experienced this with a plugin that reaches out to a remote server to collect XML data to be displayed by the plugin. The problem manifested itself as a blank page where the plugin’s shortcode SHOULD have displayed formatted version of the remote data. 

The quickest way to diagnose issues like this is to modify the wp-config.php so that the line “define(‘WP_DEBUG’, false);” reads as “define(‘WP_DEBUG’, true);” temporarily so you can view the errors that WordPress by default will hide from you.

Doing so in this case returned the following error:

Warning: file_get_contents() [function.file-get-contents]: http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/overthet/public_html/domainname.com/wp-content/plugins/someplugin/someplugin.php on line 37

By going back and searching the php.ini file in the root website for the phrase “allow_url_fopen” we were able to find the appropriate line and set it to read as follows: allow_url_fopen = On

A quick solution to a vexing problem. If you search for that in your local php.ini file and don’t find it, you might try adding the command to that file in order for this to take effect.

Do you have any other tips on tweaking your WordPress site using hte php.ini file? If so, use the comments below to post legitimate comments!

Stalk Me...

Michael Gibbs

I'm a technologist at heart, assisting companies best utilize the Internet to market themselves and sell their products and services online. This includes organizations as large as Google and as small as one or two individuals.
At Over The Top and Exhibit A Communications, I've programmed solutions for Google as well as at least one other company that was later acquired by Google.

I've been CTO of an Internet SaaS company and spent my time pretty evenly between guiding the future technical strategy of the company, architecting software solutions for my dev teams, designing and running a data center to service our clients world-wide as well as being a technical evangalist/sales engineer to our media clients large and small.

I've also been Chief Photographer of the Daily Sun/Post newspaper back when it was a 5-day a week daily newspaper.

I also spent a great many years as a beach lifeguardfor the City of San Clemente as well as Jr. Lifeguard instructor and then as it's program coordinator.
Bragging rights
Private Pilot with Instrument rating and proud husband of soon to be 25 years (and counting).
Stalk Me...

Latest posts by Michael Gibbs (see all)

Leave a Reply