0

I am trying to get cURL to work on the above system.

In the php.ini it says that curl is enabled, and when I do:

curl -V

I get:

curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1j zlib/1.2.11 brotli/1.0.7 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3 Release-Date: 2020-01-08 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp Features: AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets

which I guess is the right response.

However, when I try to use a simple php script beginning with:

$curl = curl_init();

I get:

PHP Fatal error: Uncaught Error: Call to undefined function curl_init() in /home/user/code_and_data_feb_2018/lex-code-november-2021/voice1.php:13 Stack trace: #0 {main} thrown in /home/user/code_and_data_feb_2018/lex-code-november-2021/voice1.php on line 13

which is the line of the above code.

Going back to directly putting a cURL request in the terminal, I get:

curl https://developer.voicemaker.in/voice/api -H "Authorization: Bearer 49eacc50-ea3a-11ec-a0c8-43a657921d53" -H "Content-Type: application/json" -d '{"Engine": "neural", "VoiceId": "ai3-Jony", "LanguageCode": "en-US", "Text": "Welcome to the Air.", "OutputFormat": "mp3", "SampleRate": "48000", "Effect": "default", "MasterSpeed": "0", "MasterVolume": "0", "MasterPitch": "0" }' > '{ "success": true, "path": "https://developer.voicemaker.in/uploads/1605002662512-voicemaker.in-speech.mp3"}'; bash: { "success": true, "path": "https://developer.voicemaker.in/uploads/1605002662512-voicemaker.in-speech.mp3"}: No such file or directory

Does the bash comment mean that the cURL command is not recognised, like the php code above, or does "success" mean that the command has worked, but the "No such file or directory" indicates that there is a different issue?

Bit of a puzzle, so any help appreciated. WW

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
PhilB
  • 7
  • 6

0 Answers0