PEAR services_weather

Creating and modifying plugins.
Post Reply
davepharos
Posts: 3
Joined: Thu Jan 24, 2008 3:04 am

PEAR services_weather

Post by davepharos »

Ok, i've been banging my head on this since yesterday, and have not been able to figure it out. Hopefully someone here can give me some ideas.

Trying to install the weather module. I see it needs PEAR services_weather.
Contact my web host, and they install it for me.

I still get the dreaded "Loading the PEAR Services/Weather module failed. Please insure that the module is installed."

So, thinking its a path statement problem or something of that nature, i do a few searches on this board. Come back with some things to try.

Download the weather_services 1.4.2 package from pear.php.net. unzip all the files on my machine. I change the folder name to Services, and upload it into my bundled-libs folder.

Now all the data disappeared off my blog, the only thing that shows is the header. Sidebars, gone. Main pages, gone. I can uninstall it no problem, so its not like i lost anything.

Grr, frustrating. Not sure what else to try at this point.

In the Services dir, i have the following files: Weather.php, buildMetarDB.php. there are also 3 sub dir, examples, images, and Weather.

I upload everything, though the posts i read only seem to mention Weather.php. tried deleting everything but Weather.php, but that just gives me an error message.

any help, ideas, thoughts appreciated :)

thanks
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: PEAR services_weather

Post by garvinhicking »

Hi!

IF something simply disappears, this usually means you get a Fatal PHP Error. Check your phpinfo() output to see if maybe display_errors is Off so that they are concealed from you. Ask your provider where the error logs can be found. Usually, it's a failed require() statement.

If your server installed the weather module, it might be that your local PEAR installation is not in the include_path setting?

You could try to copy the Services directory inside the serendipity_plugin_weather directory? Sadly I'm fishing in the green as well, because I haven't yet used this plugin...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
davepharos
Posts: 3
Joined: Thu Jan 24, 2008 3:04 am

Post by davepharos »

thanks for your reply.

I found the error message. not that it helps me much :)
i get the same error if i move the Services folder into the plugin folder,
except the error message actually shows up on my blog page, instead of
making it blank. but its the same message.

PHP Fatal error: Call to undefined method PEAR_Error::setUnitsFormat() in home/xxx/public_html/serendipity/plugins/serendipity_plugin_weather/serendipity_plugin_weather.php on line 138

line 138 is:
$metar->setUnitsFormat($unitString);
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Hm, strange. I believe the problem is the mixture of a local PEAR and a PEAR provided by Serendipity. Sadly PEAR.php is a very bad example of a core library, because it does not check for double icnlusion.

So if s9y includes its own bundled PEAR.php, but server-installed PEAR modules incklude the local PEAR.php, there will be a clash of nomenclature that PEAR does not catch.

The only way I see to solve this is to remove the server-installed Weather service and only install it in your bundled-libs, so that the local PEAR is not preferred.

Sadly I can't get to run the Weather plugin to work here myself, something must have changed in a newer Weather PEAR release.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Could we check for double inclusion by (re)moving the Serendipity-bundled PEAR.php?
Judebert
---
Website | Wishlist | PayPal
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!
judebert wrote:Could we check for double inclusion by (re)moving the Serendipity-bundled PEAR.php?
That would mean we'd have to also change all bundled-libs PHP files to not include our PEAR.php, but the server's PEAR.php. And what happens, if a server does not have its PEAR.php?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
davepharos
Posts: 3
Joined: Thu Jan 24, 2008 3:04 am

Post by davepharos »

It certainly isn't a deal killer if i can't get the weather plugin to work, just would have been sort of cool. :)

i'll ask my provider to remove services_weather and put the Services folder back into the bundled-lib dir, and we will see what happens.

edit
They removed it. Nothing changed, still the same as described above.
Post Reply