Running on Centos 7 system. phpinfo() says curl is enabled, but when I run this code:
<?php
// API
$url = 'https://api.openai.com/v1/embeddings';
// Create a new cURL resource
$ch = curl_init($url);
?>
I get error: PHP Fatal error:
Uncaught Error: Call to undefined function curl_init()
If I try to install it says it's already installed:
yum install php-curl
Package php-common-8.1.14-1.el7.remi.x86_64 already installed and latest version
All out of answers. What can I try from here? Why is curl not executing?
php --version
PHP 8.1.14 (cli) (built: Jan 4 2023 06:45:14) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.1.14, Copyright (c) Zend Technologies
with Zend OPcache v8.1.14, Copyright (c), by Zend Technologies
phpinfo();
cURL support enabled
cURL Information 7.29.0
php -i | grep "curl"
/etc/php.d/20-curl.ini,
curl
curl.cainfo => no value => no value
In /etc/php.d/20-curl.ini:
extension=curl.so
yum list *curl*
Installed Packages
curl.x86_64 7.29.0-59.el7_9.1 installed
libcurl.x86_64 7.29.0-59.el7_9.1 installed
libcurl-devel.x86_64 7.29.0-59.el7_9.1 installed
python-pycurl.x86_64 7.19.0-19.el7 @base
Available Packages
collectd-curl.x86_64 5.8.1-1.el7 epel
collectd-curl_json.x86_64 5.8.1-1.el7 epel
collectd-curl_xml.x86_64 5.8.1-1.el7 epel
curlftpfs.x86_64 0.9.2-14.el7 epel
flickcurl.x86_64 1.25-2.el7.nux nux-dextopflickcurl-debuginfo.x86_64 1.25-2.el7.nux nux-dextopflickcurl-devel.x86_64 1.25-2.el7.nux nux-dextopfuse-curlftpfs.x86_64 0.9.1-1.el6.rf rpmforge
libcurl.i686 7.29.0-59.el7_9.1 updates
libcurl-devel.i686 7.29.0-59.el7_9.1 updates
nbdkit-plugin-curl.x86_64 1.2.7-2.el7 epel
ocaml-curl.x86_64 0.7.5-3.el7 epel
ocaml-curl-devel.x86_64 0.7.5-3.el7 epel
perl-WWW-Curl.x86_64 4.15-13.el7 base
php-pear-Net-Curl.noarch 1.2.5-10.el7 epel
python34-pycurl.x86_64 7.43.0-7.el7 epel
python36-pycurl.x86_64 7.43.0-7.el7 epel
uwsgi-alarm-curl.x86_64 2.0.18-8.el7 epel
uwsgi-plugin-curl-cron.x86_64 2.0.18-8.el7 epel