1

I recently updated the system to 18.04 and it has hosed cURL. 18.04 installed PHP 7.2 but my nginx installation is using 7.1 FPM. When I run a phpinfo() from the web server, it shows the system reading a curl.ini, but the cURL module is not shown below, and code that requires cURL doesn't work.

I've read this **curl** is not working on Ubuntu 18.04 LTS and the answer (uninstall/reinstall libcurl4) didn't help.

I've done "phpenmod -v 7.1 curl", the module shows in the "enabled_by_admin" directory. There wasn't a curl.so but I copied it out of the 7.2 directory. Restarted, rebooted, everything. Still no cURL.

When I do "php -m" it shows curl, but that's for v7.2 of course, not the 7.1 FPM that my web server is running. I've been chasing my tail trying to get this running again, any help would be appreciated.

1

Well, I gave up and simply converted all 12 sites that I'm running to use 7.2. Turns out it was easier than trying to stay on 7.1.

I updated the default 7.2 installation to contain all the components I needed (including FPM and many others), then edited each site's nginx.conf to reference 7.2 and it's all working.

Thanks!

| improve this answer | |
0
  1. Search NGINX config. Instructions: https://devanswers.co/nginx-config-file-location/
  2. Find in conf file "fastcgi_pass" which php version is used as fpm. Example for unix socket connection fastcgi_pass unix:/run/php/php7.2-fpm.sock; In this case you can understood that we deal with php 7.2 and ofcourse with modules installed in php 7.2.
  3. Looks like you have a different version php installed on your system. Different version of php means different configs (php.ini) and different modules (including curl). Choose which php you want use. In your case if you continue using 7.2 then you need install znd configure curl module for it. If php 7.1 already have and wokr with curl and you not need 7.2 you need switch to 7.1 in NGINX conf. http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_pass
  4. Find socket path to php 7.1 in php conf (php.ini). Example: isten = /run/php/php7.1-fpm.sock Check if it exist: ls -lah /run/php/php7.1-fpm.sock
  5. Replace socket path in fastcgi_pass in NGINX conf. For example fastcgi_pass unix:/run/php/php7.1-fpm.sock; (In some case can be setup with host:IP. Need your choice, what is better for you: unix socket or host. In this tutorial i talk about socket)
  6. Restart NGINX: sudo service nginx restart
| improve this answer | |
  • Thank you, but I didn't really want or care about 7.2. It just got installed for me by the 18.04 upgrade. The server is doing fine with 7.1. What I'm trying to figure out is how to get cURL working for the 7.1 In addition, 7.1 PHP is working just fine. The only thing I can't get working is cURL on the 7.1 FPM. Thx – CLWill Nov 11 '18 at 21:51
  • 1) You told curl is still work with php 7.1. Right? 2) In your case in web-browser phpinfo() you see php 7.2? Right? If 1 and 2 correct then you need switch which php listen NGINX. I wrote above how you can do it. – mature Nov 11 '18 at 21:56
  • Or try reinstall curl for 7.1: try sudo apt-get install php7.1-curl or sudo apt-get install php-curl and restart php-fpm. – mature Nov 11 '18 at 22:06
  • No, you have it backwards. My phpinfo() from the web server shows 7.1 (and no cURL). My command line shows 7.2. – CLWill Nov 11 '18 at 22:06
  • Ah, sorry. Try sudo apt install php7.1-curl and sudo service php-fpm restart – mature Nov 11 '18 at 22:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.