Curl_setopt_array(): Array keys must be CURLOPT constants or equivalent integer values

Hi! After upgrading to NC 23 I am constantly getting the error:

curl_setopt_array(): Array keys must be CURLOPT constants or equivalent integer values at /var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php#70

My apps are not updated, while in the Overview I am invited to upgrade from 23 to 22.2.23.

Package versions:
OS: Centos 6.10
NC: 23.0.0.10
PHP: 7.3.25
MySQL: 5.7.36
Curl: 7.74.0 (x86_64-redhat-linux-gnu) libcurl/7.74.0 OpenSSL/1.0.1e-fips zlib/1.2.3 c-ares/1.17.1 libssh2/1.8.2
php-pear: 1.10.12

Snapshot from CurlFactory.php:

       // Add handler options from the request configuration options
        if (isset($options['curl'])) {
            $conf = \array_replace($conf, $options['curl']);
        }

        $conf[\CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy);
        $easy->handle = $this->handles ? \array_pop($this->handles) : \curl_init();
        curl_setopt_array($easy->handle, $conf);

Screenshot from Overview screen:

image

Let me also add, when I run pecl list-all I am getting: Connection to ssl://pecl.php.net:443’ failed:` Perhaps this is the reason?

PS Cannot downgrade to v.22 :frowning:

I have the same problem.
OS: Centos6.10
Nextcloud version 23.0.0
MySQL version 8.0.27
Apache 2.2.15
PHP version 7.3.25
OpenSSL version 1.0.1e-fips
curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.44 zlib/1.2.3 libidn/1.18 libssh2/1.4.2

[PHP] Error: curl_setopt_array(): Array keys must be CURLOPT constants or equivalent integer values at /3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php#70

I’ve searched the forum but I can’t find an answer to the problem.

1 Like

It seems, the clue may be found over here: https://community.letsencrypt.org/t/rhel-centos-6-openssl-client-compatibility-after-dst-root-ca-x3-expiration/161032/89.

What I’ve done: replaced CURLOPT_RESOLVE with int value 1023 in lib/private/Http/Client/DnsPinMiddleWare.php. After that I am able to update the apps, and the notice that my instance cannot reach Internet disappeared.

As far as I understand this is the last version, which may be run over Centos 6.10 with PHPv7.3…

Perhaps, this may be useful for you as well.

Thanks for your answer.
In the end I decided to update the OS and reinstall. Everything works smoothly.

1 Like

I think this is the best solution!