Author Topic: Forecast script error  (Read 489 times)

0 Members and 1 Guest are viewing this topic.

Offline thuman5

  • Member
  • *
  • Posts: 12
    • tkhuman.com
Forecast script error
« on: July 24, 2018, 10:53:36 AM »
I recently move my website to another hosting co. Now, when the forecast page is brought up, at the top it says "Warning: curl_setop(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set in..." and it lists the path to the advforecast2.php file on line 1222. I am fairly certain it has something to do with permissions because if I run it off my web server, it works correctly but off of the hosted copy of the site I get the error, and no forecast any where.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Forecast script error
« Reply #1 on: July 24, 2018, 10:07:24 PM »
It's a PHP setup thing on the host.  Either they have safe_mode = on (not recommended) or a open_basedir setting that's causing the issue with PHP itself.

Contact the tech support for the hoster showing the problem.  The advforecast2.php script needs CURLOPT_FOLLOWLOCATION enabled due to the way the api.weather.gov server responds to a point forecast query with a redirect to a gridpoint forecast.  (Grrr)
But.. that's the way they built the API.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline thuman5

  • Member
  • *
  • Posts: 12
    • tkhuman.com
Re: Forecast script error
« Reply #2 on: July 25, 2018, 01:34:14 PM »
I put a phpinfo.php file out there and do not see CURLOPT_FOLLOWLOCATION, and what should the Open basedir be?

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Forecast script error
« Reply #3 on: July 25, 2018, 11:47:49 PM »
The CURLOPT_FOLLOWLOCATION is not set in php.ini -- it is in the script using curl.  The warning message
Quote
Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set in /vdb/home/vh2311/www/tkhuman.com/advforecast2.php on line 1222
is a PHP configuration error and has to be corrected by your website hoster.

Your PHP 5.4.23 is very old.. if you can update to PHP 5.6.x or PHP 7.2.x which are current versions, and that may fix the issue.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

 

anything