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.

CLWill
  • 21

2 Answers2

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!

CLWill
  • 21
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
slava
  • 4,085