[GH-ISSUE #179] Undefined offset: 1 error while launching? #117

Closed
opened 2026-02-27 19:26:09 +03:00 by kerem · 1 comment
Owner

Originally created by @makandz on GitHub (Dec 25, 2019).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/179

I just setup the latest version of this API using composer on my CentOS System running PHP 7.2. It works fine on my Windows machine but my Linux machine posts the following errors when I try loading any page with the autoload required.

Notice: Undefined offset: 1 in /var/www/html/vendor/jwilsson/spotify-web-api-php/src/Request.php on line 237

Fatal error: Uncaught SpotifyWebAPI\SpotifyWebAPIException: An unknown error occurred. in /var/www/html/vendor/jwilsson/spotify-web-api-php/src/Request.php:57 Stack trace: #0 /var/www/html/vendor/jwilsson/spotify-web-api-php/src/Request.php(254): SpotifyWebAPI\Request->parseBody(NULL, 0) #1 /var/www/html/vendor/jwilsson/spotify-web-api-php/src/Request.php(104): SpotifyWebAPI\Request->send('POST', 'https://account...', 'grant_type=clie...', Array) ....

Any help?

Update: Doing some more investigation it looks like my curl_exec is returning with a false Boolean value.

Originally created by @makandz on GitHub (Dec 25, 2019). Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/179 I just setup the latest version of this API using composer on my CentOS System running PHP 7.2. It works fine on my Windows machine but my Linux machine posts the following errors when I try loading any page with the autoload required. `Notice: Undefined offset: 1 in /var/www/html/vendor/jwilsson/spotify-web-api-php/src/Request.php on line 237` `Fatal error: Uncaught SpotifyWebAPI\SpotifyWebAPIException: An unknown error occurred. in /var/www/html/vendor/jwilsson/spotify-web-api-php/src/Request.php:57 Stack trace: #0 /var/www/html/vendor/jwilsson/spotify-web-api-php/src/Request.php(254): SpotifyWebAPI\Request->parseBody(NULL, 0) #1 /var/www/html/vendor/jwilsson/spotify-web-api-php/src/Request.php(104): SpotifyWebAPI\Request->send('POST', 'https://account...', 'grant_type=clie...', Array) ....` Any help? Update: Doing some more investigation it looks like my curl_exec is returning with a false Boolean value.
kerem closed this issue 2026-02-27 19:26:10 +03:00
Author
Owner

@makandz commented on GitHub (Dec 25, 2019):

Managed to fix it, SELinux for some reason was preventing my curl requests from going out. Solved 👍

<!-- gh-comment-id:568830419 --> @makandz commented on GitHub (Dec 25, 2019): Managed to fix it, SELinux for some reason was preventing my curl requests from going out. Solved 👍
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-web-api-php#117
No description provided.