0

I am trying to fetch RTMP url using PHP CURL, but unfortunately php curl says >Protocol "rtmp" not supported or disabled in libcurl

I have installed rtmpdump and upgraded CURL to 7.47.1 latest stable version on my Centos 6.7 VPS. Following is the response from curl -V shell command

curl 7.47.1 (x86_64-pc-linux-gnu) libcurl/7.47.1 OpenSSL/1.0.1e zlib/1.2.3 librtmp/2.3 Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp Features: IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets

It clearly shows support for rtmp protocol, but when I check phpinfo() output it lists all the protocols given below under curl except rtmp,

Protocols dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp

I have tried everything, upgraded curl, rebuild curl with rtmplib support, upgraded php to 5.6 but have not got any success as yet. Also phpinfo is showing correct version of CURL that is 7.47.1

Any help in this regard will be appreciated.

1 Answers1

0

You need to rebuild the php curl extension with the newly installed curl library.

Florin Asăvoaie
  • 7,057
  • 23
  • 35
  • A bit of detail on how to do this would improve the answer – Dave M Mar 21 '16 at 14:15
  • That extremely highly depends on how PHP was installed, how cURL was installed, if you have the requires tools to do it on that machine or not, etc. – Florin Asăvoaie Mar 21 '16 at 14:23
  • @Florin thanks for he answer. Curl was installed using city-fan.org repo and after that I upgraded php56 which was previously php54 along with all its dependencies and libraries including phpcurl. I can fetch RTMP source directly via curl but it does not work via php curl. – Aamir Hussain Mar 22 '16 at 04:44
  • Let me know if I still need to recompile php curl, though I have installed php curl while curl new version was installed already. – Aamir Hussain Mar 22 '16 at 04:48
  • Yeah, you will need to uninstall the php-curl module from the repo and compile a custom one with the curl version from the city-fan.org repo. Something like this: yum remove php-curl. yum install php-devel. Download the source RPM, unpack it, find the source archive, unpack it, go to the curl module folder inside the source and run phpize, ./configure, make, then copy the .so module to the extensions directory and create a curl.ini file to load the extension in /etc/php.d. Wrote this out of my head so sorry for missing steps but you get the idea I hope. – Florin Asăvoaie Mar 22 '16 at 19:27