Upgrade from 3.10 to 3.11. admin/environment/php extension/curl failes

Upgrade from 3.10 to 3.11. admin/environment/php extension/curl failes

by Raivo P -
Number of replies: 6

Hello

We have Ubuntu 18, and PHP updated to 7.3

Whene trying to upgrade our Moodle from 3.10 to 3.11. Environment server check says, that 

php_extensioncurl

The cURL PHP extension is now required by Moodle, in order to communicate with Moodle repositories.

When fallowing that link instructions for Ubuntu https://docs.moodle.org/310/en/admin/environment/php_extension/curl

I'm getting error when running "make " from "Compile and install the PHP/cURL module" part. Can someone suggest what can be done to overcome that error.

moodleadmin@testmoodle:~/curl/php-src/ext/curl$ make

/bin/bash /home/moodleadmin/curl/php-src/ext/curl/libtool --mode=compile cc -I. -I/home/moodleadmin/curl/php-src/ext/curl -I/home/moodleadmin/curl/php-src/ext/curl/include -I/home/moodleadmin/curl/php-src/ext/curl/main -I/home/moodleadmin/curl/php-src/ext/curl -I/usr/include/php/20200930 -I/usr/include/php/20200930/main -I/usr/include/php/20200930/TSRM -I/usr/include/php/20200930/Zend -I/usr/include/php/20200930/ext -I/usr/include/php/20200930/ext/date/lib -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2    -c /home/moodleadmin/curl/php-src/ext/curl/interface.c -o interface.lolibtool: compile:  cc -I. -I/home/moodleadmin/curl/php-src/ext/curl -I/home/moodleadmin/curl/php-src/ext/curl/include -I/home/moodleadmin/curl/php-src/ext/curl/main -I/home/moodleadmin/curl/php-src/ext/curl -I/usr/include/php/20200930 -I/usr/include/php/20200930/main -I/usr/include/php/20200930/TSRM -I/usr/include/php/20200930/Zend -I/usr/include/php/20200930/ext -I/usr/include/php/20200930/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /home/moodleadmin/curl/php-src/ext/curl/interface.c  -fPIC -DPIC -o .libs/interface.o

/home/moodleadmin/curl/php-src/ext/curl/interface.c:85:10: fatal error: ext/standard/php_smart_str.h: No such file or directory

 #include "ext/standard/php_smart_str.h"

          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

compilation terminated.

Makefile:209: recipe for target 'interface.lo' failed

make: *** [interface.lo] Error 1

Thanks, Raivo 

Average of ratings: -
In reply to Raivo P

Re: Upgrade from 3.10 to 3.11. admin/environment/php extension/curl failes

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
apt install php7.3-curl
Average of ratings: Useful (1)
In reply to Emma Richardson

Re: Upgrade from 3.10 to 3.11. admin/environment/php extension/curl failes

by Raivo P -
Thanks for reply. Unfortunately its already there
Reading state information... Done 
php7.3-curl is already the newest version (7.3.31-1+ubuntu18.04.1+deb.sury.org+1).
In reply to Raivo P

Re: Upgrade from 3.10 to 3.11. admin/environment/php extension/curl failes

by Ken Task -
Picture of Particularly helpful Moodlers

If your 3.10 is still accessible, go to Site Admin -> Server -> phpinfo.   If you can't get to the 3.10, create a phpinfo page:

In the code directory, create phpinfo.php and inside it only this:

<? phpinfo(); ?>
Then view with browser.

Since you attempted compiling, see if this CLI only command will show it's loaded:
php -m |grep curl

If not loaded, consult ubuntu 18.04 docs to see how that version loads php extensions.

This might help:


'SoS', Ken

In reply to Ken Task

Re: Upgrade from 3.10 to 3.11. admin/environment/php extension/curl failes

by Raivo P -

Thank you for advice. 

I did revert VM (test moodle) and fallowed instructions to upgrade to php7.4 from here https://php.watch/articles/Ubuntu-PHP-7.4 (I did not remove older version)

When i check Site Admin -> Server -> phpinfo there is PHP Version 7.4.24 and there can be see this - /etc/php/7.4/apache2/conf.d/20-curl.ini, /etc/php/7.4/apache2/conf.d/20-dom.ini

When i run 

moodleadmin@testmoodle:~$ php -m |grep curl

curl

I also enabled extension=curl in /etc/php/7.4/apache2/php.ini fail

;extension=bz2

extension=curl

;extension=ffi

;extension=ftp

So looks like the curl extension is there and probably enabled, but I still see from Site administration/Server/Environment 

"php_extension curl must be installed and enabled The cURL PHP extension is now required by Moodle, in order to communicate with Moodle repositories."

and 

"cURL PHP extension is not installed, if this test fails, it indicates a potential problem. It has been detected that libcurl doesn't have CURLOPT_PROTOCOL support. An up-to-date libcurl installation is recommended for security reasons."

Thank you in advance!

Raivo


In reply to Raivo P

Re: Upgrade from 3.10 to 3.11. admin/environment/php extension/curl failes

by Ken Task -
Picture of Particularly helpful Moodlers

The php curl extension requires support from libcurl.  Missing libcurl is kinda surprising as when one installs php-curl the package manager of your OS should see that supports are needed and install them as well.

So use your package manager to explore libcurl.

'SoS', Ken

In reply to Ken Task

Re: Upgrade from 3.10 to 3.11. admin/environment/php extension/curl failes

by Raivo P -

Thank you. I'll investigate it further.

Regards,

Raivo