akashrchandran / spotify-lyrics-api

A Rest API for fetching lyrics from Spotify which is powered by Musixmatch. Commandline version is available at akashrchandran/syrics.
http://github.akashrchandran.in/spotify-lyrics-api/
GNU General Public License v3.0
348 stars 28 forks source link

Internal Error: Failure to open Required file #42

Open Rcuz8 opened 1 month ago

Rcuz8 commented 1 month ago

Description

I followed the setup steps:

$ git clone https://github.com/akashrchandran/spotify-lyrics-api.git
$ cd spotify-lyrics-api
$ php -S localhost:8000 api/index.php

And, when pinging an endpoint, The server threw a Failure to open Required file error on this line:

require_once __DIR__ . '/../vendor/autoload.php';

Potential fix

The issue resolved when I changed the line above to:

require_once __DIR__ . '/../src/Spotify.php';
require_once __DIR__ . '/../src/SpotifyException.php';
akashrchandran commented 5 days ago

This is for when you're using the API as a package to obtain lyrics. Rather than downloading the repository, you should use Composer to install it.

composer require akashrchandran/spotify-lyrics-api