Unable to Enable PHP library's Ubuntu 20 with PHP 8.0

Operating system: UNIX Ubuntu
OS version: 20.04
PHP version: 8.0.2

Hello,
I have a project that requires enabling libraries (GD, Curl, Zip).

I looked online on old Virtualmin blog posts and Stackoverflow help, but half of them weren’t working, and the other half made more problems than fining problems. Most of the resources were made for CentOS commanded ligne only and not for Ubuntu 20.

From Stackoverflow, I tried the line: sudo apt-get install php8.0-gd
But GD wasn’t enabled.

How could I enable PHP libraries? Are they away from the GUI, if not from the command line?
Do you think PHP8 could cause the problem?

Thanks

@Daniel_Server,

After installing the missing library, did you do a “systemctl restart apache2”?

The module won’t be activated until you restart Apache. Give it a try and then reload the page and you’ll see the module is now acknowledged.

Best Regards,
Peter Knowles | TPN Solutions

Need Professional, Affordable Technical Support? Reach out at https://tpnassist.com

Thanks, it works for GD and Zip but not for Curl.

I try: sudo apt-get install php7-curl
and sudo apt install curl
and other lines, but I’m unable to install Curl, Do you have a line with will make it works.
I restart the webserver also.

(I witch to PHP 7.4)
Thanks

@Daniel_Server,

sudo apt install -y php8.0-curl && sudo systemctl restart apache2

Best Regards,
Peter Knowles | TPN Solutions

@Daniel_Server,

The above is for “PHP 8.0”, for other versions switch “php8.0” with “phpA.B” where “A” represents the “major” and “B” represents the “minor” version number.

ex. php7.4, php7.3, etc

Best Regards,
Peter Knowles | TPN Solutions

Still not working, I got the error:
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 2168997 (apt-get)

What to do?

@Daniel_Server,

That just means apt is already running in the background doing something. Usually just wait a few minutes then try again.

Best Regards,
Peter Knowles | TPN Solutions

How long should I wait? It’s been around 30 min.

@Daniel_Server,

It’s possible apt has become hung up… Try giving your system a reboot if this seems to be the case.

Best Regards,
Peter Knowles | TPN Solutions

Thanks @tpnsolutions , It’s now working I have to make a restart then use the command line and type:
PHP 8.0 : sudo apt install -y php8.0-curl && sudo systemctl restart apache2
PHP 7.4: sudo apt install -y php7.4-curl && sudo systemctl restart apache2

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.