MyBB Community Forums

Full Version: curl_setopt_array Array keys must be CURLOPT constants or equivalent integer values
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi,
I try updating from 1810 to 1811 (with changed files) So.... Congratulations, your copy of MyBB has successfully been updated to 1.8.11
But in top of the "MyBB Installation Wizard" page:


Warning [2] curl_setopt_array(): Array keys must be CURLOPT constants or equivalent integer values - Line: 6889 - File: inc/functions.php PHP 5.6.30 (Linux)
File
Line
Function[PHP]
 
errorHandler->error
/inc/functions.php
6889
curl_setopt_array
/inc/tasks/versioncheck.php
23
fetch_remote_file
/inc/functions_task.php
88
task_versioncheck
/install/upgrade.php
639
run_task
/install/upgrade.php
382
upgradedone
Warning [2] curl_setopt_array(): Array keys must be CURLOPT constants or equivalent integer values - Line: 6889 - File: inc/functions.php PHP 5.6.30 (Linux)
File
Line
Function[PHP]
 
errorHandler->error
/inc/functions.php
6889
curl_setopt_array
/inc/class_feedparser.php
46
fetch_remote_file
/inc/tasks/versioncheck.php
64
FeedParser->parse_feed
/inc/functions_task.php
88
task_versioncheck
/install/upgrade.php
639
run_task
/install/upgrade.php
382
upgradedone


[attachment=38692]




and any time trying to check for update from ACP. (version_check) i got same error and mail:
Your copy of MyBB running on (http://site.com) has experienced an error. Details of the error include:
---
Type: 2
File: inc/functions.php (Line no. 6889)
Message
curl_setopt_array(): Array keys must be CURLOPT constants or equivalent integer values
Can you post the version displayed under cURL Information (curl section) in ACP: Tools & Maintenance → View PHP Info?

Do you have the possibility of upgrading your PHP version?
I use PHP 7.1.3 and don't have this issue. If this requires PHP 7 to work though, I think the code needs to change because we shouldn't change the minimum PHP version required in a minor release.
(2017-04-05, 12:35 AM)dragonexpert Wrote: [ -> ]I use PHP 7.1.3 and don't have this issue.  If this requires PHP 7 to work though, I think the code needs to change because we shouldn't change the minimum PHP version required in a minor release.

We've encountered a similar issue with CURLOPT_CONNECT_TO because some popular PHP packages turned out to be compiled with outdated versions of curl, which is why there's an additional check for the curl version here: https://github.com/mybb/mybb/blob/mybb_1....php#L6870

If the cause is the same here, we'll update the check for CURLOPT_RESOLVE to
elseif(version_compare(PHP_VERSION, '5.5', '>=') && version_compare($curl_version, '7.21.3', '>='))
in the next version.
(2017-04-05, 12:01 AM)Devilshakerz Wrote: [ -> ]Can you post the version displayed under cURL Information (curl section) in ACP: Tools & Maintenance → View PHP Info?

curl
cURL support enabled
cURL Information 7.53.1



(2017-04-05, 12:01 AM)Devilshakerz Wrote: [ -> ]Do you have the possibility of upgrading your PHP version?

Current Stable PHP 5.6.30
eh ? how to solve it ??

$context = stream_context_create([ from line 6100
^ if you have the same issue then provide your php version & curl version & wait for reply
(2017-04-05, 12:01 AM)Devilshakerz Wrote: [ -> ]Can you post the version displayed under cURL Information (curl section) in ACP: Tools & Maintenance → View PHP Info?
cURL = 7.53.1
PHP = 5.6.30

(2017-04-05, 12:01 AM)Devilshakerz Wrote: [ -> ]Do you have the possibility of upgrading your PHP version?
Unfortunately no. The only version available in my CPanel is the version above.
same issue

cURL 7.51.0
PHP 5.6.29
Try replacing inc/functions.php with the one attached.
Pages: 1 2