You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wasn't able to install this through composer so I used php-download.com to pull the package from packagist, downloaded it as a zip and saved it on my server.
Here's the code where I called the API:
use cmfcmf_openweathermap_php_api_2_4_0\vendor\cmfcmf\openweathermap_php_api\Cmfcmf\OpenWeatherMap_Class;
use cmfcmf_openweathermap_php_api_2_4_0\vendor\cmfcmf\openweathermap_php_api\Cmfcmf\OpenWeatherMap\Exception as OWMException;
//Run Google Calendar API and Fetch Calendar Events
include '\cmfcmf_openweathermap_php_api_2_4_0\vendor\autoload.php';
$owm = new OpenWeatherMap('my API key in here');
I'm getting an error of "Fatal error: Class 'OpenWeatherMap' not found..."
I've tried several variations but can't get it to work. I wonder if it's related to my file structure. The webpage 'weather-test.php' is in the root folder. Here is the full structure showing where vendor/autoload.php and OpenWeatherMap are located.
Hi @GermanPearls,
I highly recommend to use composer – what exactly did not work when you tried?
I've also looked at the download provided by php-download.com: You'll have to first require("vendor/autoload.php") before you can use any of the classes of this project. Then you should use these imports:
I wasn't able to install this through composer so I used php-download.com to pull the package from packagist, downloaded it as a zip and saved it on my server.
Here's the code where I called the API:
I'm getting an error of "Fatal error: Class 'OpenWeatherMap' not found..."
I've tried several variations but can't get it to work. I wonder if it's related to my file structure. The webpage 'weather-test.php' is in the root folder. Here is the full structure showing where vendor/autoload.php and OpenWeatherMap are located.
Thank you in advance.
The text was updated successfully, but these errors were encountered: