cURL not found in wordpress on AWS EC2 instance - php

On my Wordpress site the cURL command doesn't seem to work:
When I login into Wordpress, it clearly says cURL is not installed:
However, when I SSH into my EC2 instance, I shows that cURL is installed:
$ curl --version
curl 7.58.0 (x86_64-pc-linux-gnu) libcurl/7.58.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.3.0 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Release-Date: 2018-01-24
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL
Because PHP is outdated, maybe it could be an PHP issue? When I check my PHP version, I shows I have the latest version installed:
$ php -v
PHP 8.2.1 (cli) (built: Jan 13 2023 10:42:21) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.1, Copyright (c) Zend Technologies
with Zend OPcache v8.2.1, Copyright (c), by Zend Technologies
But when I list all my PHP installs, I see that the top one corresponds with the one mentioned in Wordpress (7.3.33-9+ubuntu18.04.1+deb.sury.org+1):
$ dpkg --list | grep php
ii libapache2-mod-php7.3 7.3.33-9+ubuntu18.04.1+deb.sury.org+1 amd64 server-side, HTML-embedded scripting language (Apache 2 module)
ii libapache2-mod-php8.2 8.2.1-2+ubuntu18.04.1+deb.sury.org+1 amd64 server-side, HTML-embedded scripting language (Apache 2 module)
ii php 2:8.2+93+ubuntu18.04.1+deb.sury.org+2 all server-side, HTML-embedded scripting language (default)
ii php-common 2:93+ubuntu18.04.1+deb.sury.org+2 all Common files for PHP packages
ii php-curl 2:8.2+93+ubuntu18.04.1+deb.sury.org+2 all CURL module for PHP [default]
ii php-fpm 2:8.2+93+ubuntu18.04.1+deb.sury.org+2 all server-side, HTML-embedded scripting language (FPM-CGI binary) (default)
ii php-gd 2:8.2+93+ubuntu18.04.1+deb.sury.org+2 all GD module for PHP [default]
ii php-mbstring 2:8.2+93+ubuntu18.04.1+deb.sury.org+2 all MBSTRING module for PHP [default]
rc php7.0-curl 7.0.33-0ubuntu0.16.04.2 amd64 CURL module for PHP
ii php7.2-cli 7.2.34-37+ubuntu18.04.1+deb.sury.org+1 amd64 command-line interpreter for the PHP scripting language
ii php7.2-common 7.2.34-37+ubuntu18.04.1+deb.sury.org+1 amd64 documentation, examples and common module for PHP
ii php7.2-curl 7.2.34-37+ubuntu18.04.1+deb.sury.org+1 amd64 CURL module for PHP
ii php7.2-fpm 7.2.34-37+ubuntu18.04.1+deb.sury.org+1 amd64 server-side, HTML-embedded scripting language (FPM-CGI binary)
ii php7.2-gd 7.2.34-37+ubuntu18.04.1+deb.sury.org+1 amd64 GD module for PHP
ii php7.2-json 7.2.34-37+ubuntu18.04.1+deb.sury.org+1 amd64 JSON module for PHP
ii php7.2-mbstring 7.2.34-37+ubuntu18.04.1+deb.sury.org+1 amd64 MBSTRING module for PHP
ii php7.2-mysql 7.2.34-37+ubuntu18.04.1+deb.sury.org+1 amd64 MySQL module for PHP
ii php7.2-opcache 7.2.34-37+ubuntu18.04.1+deb.sury.org+1 amd64 Zend OpCache module for PHP
ii php7.2-readline 7.2.34-37+ubuntu18.04.1+deb.sury.org+1 amd64 readline module for PHP
ii php7.3 7.3.33-9+ubuntu18.04.1+deb.sury.org+1 all server-side, HTML-embedded scripting language (metapackage)
ii php7.3-cli 7.3.33-9+ubuntu18.04.1+deb.sury.org+1 amd64 command-line interpreter for the PHP scripting language
ii php7.3-common 7.3.33-9+ubuntu18.04.1+deb.sury.org+1 amd64 documentation, examples and common module for PHP
ii php7.3-json 7.3.33-9+ubuntu18.04.1+deb.sury.org+1 amd64 JSON module for PHP
ii php7.3-mysql 7.3.33-9+ubuntu18.04.1+deb.sury.org+1 amd64 MySQL module for PHP
ii php7.3-opcache 7.3.33-9+ubuntu18.04.1+deb.sury.org+1 amd64 Zend OpCache module for PHP
ii php7.3-readline 7.3.33-9+ubuntu18.04.1+deb.sury.org+1 amd64 readline module for PHP
ii php8.2 8.2.1-2+ubuntu18.04.1+deb.sury.org+1 all server-side, HTML-embedded scripting language (metapackage)
ii php8.2-cli 8.2.1-2+ubuntu18.04.1+deb.sury.org+1 amd64 command-line interpreter for the PHP scripting language
ii php8.2-common 8.2.1-2+ubuntu18.04.1+deb.sury.org+1 amd64 documentation, examples and common module for PHP
ii php8.2-curl 8.2.1-2+ubuntu18.04.1+deb.sury.org+1 amd64 CURL module for PHP
ii php8.2-fpm 8.2.1-2+ubuntu18.04.1+deb.sury.org+1 amd64 server-side, HTML-embedded scripting language (FPM-CGI binary)
ii php8.2-gd 8.2.1-2+ubuntu18.04.1+deb.sury.org+1 amd64 GD module for PHP
ii php8.2-mbstring 8.2.1-2+ubuntu18.04.1+deb.sury.org+1 amd64 MBSTRING module for PHP
ii php8.2-opcache 8.2.1-2+ubuntu18.04.1+deb.sury.org+1 amd64 Zend OpCache module for PHP
ii php8.2-readline 8.2.1-2+ubuntu18.04.1+deb.sury.org+1 amd64 readline module for PHP
I've also tried rebooting from the AWS EC2 dashboard.

lel, you have php7.0-curl and php7.2-curl and php8.2-curl, but you run WordPress on the 1 php where you don't have curl: php7.3
sudo apt update;
sudo apt install php7.3-curl;
you should consider upgrading the php you run wordpress on though: PHP7.3 went EOL 6 desember 2021; by comparison, PHP8.2 is scheduled to go EOL 8 desember 2025.
it's very rare that you need any PHP5 version other than 5.6, and any PHP7 version other than 7.4, i suggest you install php7.4 and uninstall 7.0, 7.2, and 7.3.

Related

Azure Web Apps Composer Fail (GD Extension) [duplicate]

I newly install Dompdf in Laravel Project via Composer (composer require barryvdh/laravel-dompdf). After enter the Command Terminal Reply Following Errors.
Problem 1
- dompdf/dompdf v0.7.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.
- barryvdh/laravel-dompdf v0.7.0 requires dompdf/dompdf ^0.7 -> satisfiable by dompdf/dompdf[v0.7.0].
- Installation request for barryvdh/laravel-dompdf ^0.7.0 -> satisfiable by barryvdh/laravel-dompdf[v0.7.0].
To enable extensions, verify that they are enabled in those .ini files:
- /etc/php/5.6/cli/php.ini
- /etc/php/5.6/cli/conf.d/10-opcache.ini
- /etc/php/5.6/cli/conf.d/10-pdo.ini
- /etc/php/5.6/cli/conf.d/15-xml.ini
- /etc/php/5.6/cli/conf.d/20-calendar.ini
- /etc/php/5.6/cli/conf.d/20-ctype.ini
- /etc/php/5.6/cli/conf.d/20-dom.ini
- /etc/php/5.6/cli/conf.d/20-exif.ini
- /etc/php/5.6/cli/conf.d/20-fileinfo.ini
- /etc/php/5.6/cli/conf.d/20-ftp.ini
- /etc/php/5.6/cli/conf.d/20-gettext.ini
- /etc/php/5.6/cli/conf.d/20-iconv.ini
- /etc/php/5.6/cli/conf.d/20-json.ini
- /etc/php/5.6/cli/conf.d/20-mbstring.ini
- /etc/php/5.6/cli/conf.d/20-phar.ini
- /etc/php/5.6/cli/conf.d/20-posix.ini
- /etc/php/5.6/cli/conf.d/20-readline.ini
- /etc/php/5.6/cli/conf.d/20-shmop.ini
- /etc/php/5.6/cli/conf.d/20-simplexml.ini
- /etc/php/5.6/cli/conf.d/20-sockets.ini
- /etc/php/5.6/cli/conf.d/20-sysvmsg.ini
- /etc/php/5.6/cli/conf.d/20-sysvsem.ini
- /etc/php/5.6/cli/conf.d/20-sysvshm.ini
- /etc/php/5.6/cli/conf.d/20-tokenizer.ini
- /etc/php/5.6/cli/conf.d/20-wddx.ini
- /etc/php/5.6/cli/conf.d/20-xmlreader.ini
- /etc/php/5.6/cli/conf.d/20-xmlwriter.ini
- /etc/php/5.6/cli/conf.d/20-xsl.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
How to Solve this Error
I already Installed GD using Following comment. sudo apt-get install php5-gd and also Apache Server Restarted. My Laravel Version is 5.3 and Ubuntu Version is 14.04
I have installed php7, I did the following to solve exactly the same error
sudo apt-get install php7.0-gd
sudo apt-get install php7.0-intl
sudo apt-get install php7.0-xsl
If you are working in PHP version 5.* then you have to install
sudo apt-get install php5-gd
And if you are working in PHP version 7.* then you have to install
sudo apt-get install php7.0-gd
Hope it will work...
And if you are working in PHP version 7.2 then you have to install
sudo apt-get install php7.2-gd... it worked for me
For php-8, just locate your php.ini file and uncomment the line extension=gd
Below is a picture guide for those using Xampp and Windows
Step 1: Open php.ini or locate it in your machine (C:/xampp/php/php.ini)
Step 2: Uncomment the line extension=gd by removing the semicolon
Step 3: Save your file and restart your services
Open your php.ini and uncomment this line:
;extension=php_gd2.dll
It may not be enabled for php-cli, you can enable like this;
sudo phpenmod gd
UPDATE
I guess, you are using ppa:ondrej php package (5.6), which is confusing you with default ubuntu 14.04 php package (5.5.9).
To install php 5.6 gd library from ppa:ondrej, you should use:
sudo apt-get install php5.6-gd
PHP 7.4.2 (cli) (built: Feb 5 2020 16:50:21) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.2, Copyright (c), by Zend Technologies
For Php 7.4.2
sudo apt-get install php7.4-gd
sudo phpenmod gd
Before installing the missing dependency, you need to check which version of PHP is installed on your system.
php -v
PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.10-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies
In this case it's php7.2. apt search php7.2 returns all the available PHP extensions.
apt search php7.2
Sorting... Done
Full Text Search... Done
libapache2-mod-php7.2/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
server-side, HTML-embedded scripting language (Apache 2 module)
libphp7.2-embed/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
HTML-embedded scripting language (Embedded SAPI library)
php-all-dev/bionic,bionic 1:60ubuntu1 all
package depending on all supported PHP development packages
php7.2/bionic-updates,bionic-updates,bionic-security,bionic-security 7.2.10-0ubuntu0.18.04.1 all
server-side, HTML-embedded scripting language (metapackage)
php7.2-bcmath/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
Bcmath module for PHP
php7.2-bz2/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
bzip2 module for PHP
php7.2-cgi/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
server-side, HTML-embedded scripting language (CGI binary)
php7.2-cli/bionic-updates,bionic-security,now 7.2.10-0ubuntu0.18.04.1 amd64 [installed,automatic]
command-line interpreter for the PHP scripting language
php7.2-common/bionic-updates,bionic-security,now 7.2.10-0ubuntu0.18.04.1 amd64 [installed,automatic]
documentation, examples and common module for PHP
php7.2-curl/bionic-updates,bionic-security,now 7.2.10-0ubuntu0.18.04.1 amd64 [installed]
CURL module for PHP
php7.2-dba/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
DBA module for PHP
php7.2-dev/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
Files for PHP7.2 module development
php7.2-enchant/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
Enchant module for PHP
php7.2-fpm/bionic-updates,bionic-security,now 7.2.10-0ubuntu0.18.04.1 amd64 [installed]
server-side, HTML-embedded scripting language (FPM-CGI binary)
php7.2-gd/bionic-updates,bionic-security,now 7.2.10-0ubuntu0.18.04.1 amd64 [installed]
GD module for PHP
php7.2-gmp/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
GMP module for PHP
php7.2-imap/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
IMAP module for PHP
php7.2-interbase/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
Interbase module for PHP
php7.2-intl/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
Internationalisation module for PHP
php7.2-json/bionic-updates,bionic-security,now 7.2.10-0ubuntu0.18.04.1 amd64 [installed,automatic]
JSON module for PHP
php7.2-ldap/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
LDAP module for PHP
php7.2-mbstring/bionic-updates,bionic-security,now 7.2.10-0ubuntu0.18.04.1 amd64 [installed,automatic]
MBSTRING module for PHP
php7.2-mysql/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
MySQL module for PHP
php7.2-odbc/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
ODBC module for PHP
php7.2-opcache/bionic-updates,bionic-security,now 7.2.10-0ubuntu0.18.04.1 amd64 [installed,automatic]
Zend OpCache module for PHP
php7.2-pgsql/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
PostgreSQL module for PHP
php7.2-phpdbg/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
server-side, HTML-embedded scripting language (PHPDBG binary)
php7.2-pspell/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
pspell module for PHP
php7.2-readline/bionic-updates,bionic-security,now 7.2.10-0ubuntu0.18.04.1 amd64 [installed,automatic]
readline module for PHP
php7.2-recode/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
recode module for PHP
php7.2-snmp/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
SNMP module for PHP
php7.2-soap/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
SOAP module for PHP
php7.2-sqlite3/bionic-updates,bionic-security,now 7.2.10-0ubuntu0.18.04.1 amd64 [installed]
SQLite3 module for PHP
php7.2-sybase/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
Sybase module for PHP
php7.2-tidy/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
tidy module for PHP
php7.2-xml/bionic-updates,bionic-security,now 7.2.10-0ubuntu0.18.04.1 amd64 [installed]
DOM, SimpleXML, WDDX, XML, and XSL module for PHP
php7.2-xmlrpc/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
XMLRPC-EPI module for PHP
php7.2-xsl/bionic-updates,bionic-updates,bionic-security,bionic-security 7.2.10-0ubuntu0.18.04.1 all
XSL module for PHP (dummy)
php7.2-zip/bionic-updates,bionic-security 7.2.10-0ubuntu0.18.04.1 amd64
Zip module for PHP
You can now proceed to installing the missing dependency by running:
sudo apt install php7.2-gd
if you are working in PHP version 7.2 then you have to install
sudo apt-get install php7.2-gd
For php 7.1
sudo apt-get install php7.1-gd
Cheers!
I'm working on php 8.0.9, and I just uncomment this on php.ini in xampp/php/php.ini directory.
from
;extension=gd
to
extension=gd
and it's work normal again
The solution is quite simple.
In your php.ini, just uncomment the line extension=php_gd2.dll (or .so extension for unix systems.)
Hope it helps.
This worked for me:
composer require "ext-gd:*" --ignore-platform-reqs
As of Composer 2.0 on Arch, I use: --ignore-platform-req=ext-gd
Eg:
php composer install -n --ignore-platform-req=ext-gd
Eg: (to ignore multiple requirements)
php composer install -n --ignore-platform-req=ext-gd --ignore-platform-req=ext-ldap
Ignoring Composer requirements may be necessary because Composer may return false warnings on dependencies that are already properly installed and enabled, consider this Arch forum article:
I have installed php-gd and uncommeted extension=gd.so in /etc/php/php.ini as the wiki says
Thanks for this answer on a related Question, How to always use ignore-platform-reqs flag when running composer?
Using Manjaro(Arch) Linux:
$ sudo pacman -S php-gd
In file /etc/php/php-ini, add the line:
extension=gd.so
For Windows :
Uncomment this line in your php.ini file
;extension=php_gd2.dll
If the above step doesn't work uncomment the following line as well:
;extension=gd2
sudo apt-get install php7.4-zip
Use your version of php. Like here I used 7.4
CentOS
sudo yum install php-gd
Unbuntu
sudo apt install php-gd
First Check your php version
sudo php -v
Then install php gd package of relevent version.
sudo apt-get install php${version}-gd
Finally run
composer update
On CentOS 7, try running following command:
sudo yum install php72u-gd.x86_64
in docker I found a same problem, even after
"rm /etc/apt/preferences.d/no-debian-php"
then
"apt update"
"apt install php7.4-gd"
"php composer.phar update"
error " ..... ext-gd ....."
so my solution is direct using php7.4
"php7.4 composer.phar update"
and its work. I dont know why.
It may help you
apt install php-xml
systemctl restart apache2
From reference here, you may learn in brief.
Thanks :)
On Local or Xampp in windows
go to : C:\xampp\php\php.ini
uncomment extension=gd
PHP VERSION - 7.3.21
WAMP SERVER
// use below command to fix ext-gd issue
// work for me
composer require "ext-gd:*" --ignore-platform-reqs phpoffice/phpspreadsheet

unable to enable php-gmp for php7.4 with ddev

Because of this error message the requested PHP extension gmp is missing from your system
I want to add the gmp extension to php 7.4 using DDEV.
First I made a .ddev/php/ folder and created a 99-gmp.ini file.
Second I added extension=php_gmp.so to 99-gmp.ini
I ssh login ddev ssh and run:
sudo apt install php-gmp
sudo apt-get install php-gmp
sudo apt-get install php7.4-gmp
And tried a few variants but the package isn't found
searching for apt search php-gmp results in:
Reading package lists... DoneBuilding dependency tree Reading state information... Done E: Unable to locate package php-gmp
apt search gmp results in 3 packages, all installed already:
Full Text Search... Done
libgmp10/now 2:6.1.2+dfsg-4 amd64 [installed,local]
Multiprecision arithmetic library
libhogweed4/now 3.4.1-1 amd64 [installed,local]
low level cryptographic library (public-key cryptos)
libnettle6/now 3.4.1-1 amd64 [installed,local]
low level cryptographic library (symmetric and one-way cryptos)
Looking for php7.4 extentions:
apt search php7.4
For some reason gmp isn't found?
Sorting... Done Full Text Search... Done
libapache2-mod-php7.4/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
server-side, HTML-embedded scripting language (Apache 2 module)
php7.4-bcmath/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
Bcmath module for PHP
php7.4-bz2/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
bzip2 module for PHP
php7.4-cgi/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
server-side, HTML-embedded scripting language (CGI binary)
php7.4-cli/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
command-line interpreter for the PHP scripting language
php7.4-common/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
documentation, examples and common module for PHP
php7.4-curl/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
CURL module for PHP
php7.4-fpm/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
server-side, HTML-embedded scripting language (FPM-CGI binary)
php7.4-gd/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
GD module for PHP
php7.4-intl/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
Internationalisation module for PHP
php7.4-json/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
JSON module for PHP
php7.4-ldap/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
LDAP module for PHP
php7.4-mbstring/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
MBSTRING module for PHP
php7.4-mysql/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
MySQL module for PHP
php7.4-opcache/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
Zend OpCache module for PHP
php7.4-pgsql/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
PostgreSQL module for PHP
php7.4-phpdbg/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
server-side, HTML-embedded scripting language (PHPDBG binary)
php7.4-readline/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
readline module for PHP
php7.4-soap/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
SOAP module for PHP
php7.4-sqlite3/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
SQLite3 module for PHP
php7.4-xml/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
DOM, SimpleXML, XML, and XSL module for PHP
php7.4-xmlrpc/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
XMLRPC-EPI module for PHP
php7.4-zip/now 7.4.8-1+0~20200713.23+debian10~1.gbpb2c15c amd64 [installed,local]
Zip module for PHP
Project Information
PHP version: 7.4
OS: Debian 10
NFS mount enabled: false
Database type: mariadb
MariaDB version: 10.3
Usually, you should add packages through adding webimage_extra_packages to your configuration (see the documentation):
webimage_extra_packages: [php7.4-gmp]
On restarting the containers using ddev restart, this configuration is applied and the package gets installed. Have you tried this?
Using this way helps to keep this package tied to the container ddev uses. While adding it to a running container (as you did) is not explicitly wrong, this package will be removed again if you change the PHP version or upgrade ddev. Through using the configuration, you can ensure that this package is installed again if the container images change.

pg_query(): Query failed: SSL SYSCALL error: EOF detected in php script

After reading several posts (I read an issue with OpenSSL but did not understand how to solve this error), I have not found any solutions to this issue. I understand that it is a connection failure of the postgresql database. It is not clear to me, though, why this happens in my laptop, I am working internally (localhost level) so it should be no problem at all. In fact, some time ago this worked before in my laptop, perhaps some software upgrading changed things. Nevertheless, this is what I get:
Warning: pg_query(): Query failed: SSL SYSCALL error: EOF detected in /mnt/windowsd/WEBs/php/pg.php on line 293
An SQL error occured.
Line 293 refers to:
292 # Try query or error
293 $rs = pg_query($conn, $sql);
294 if (!$rs) {
295 echo "An SQL error occured.\n";
296 exit;
297 }
and variable $conn is:
9 # connect to PostgreSQL database
10 $conn = pg_connect("user='aaaa' password='aaaa' dbname='aaaa' host='localhost'");
11 if (!$conn) {
12 echo "Not connected : " . pg_error();
13 exit;
14 }
How can I solve this SSL SYSCALL error?
Any hints are appreciated.
System:
ii postgresql-9.3 9.3.24-0ubuntu0.14.04 amd64 object-relational SQL database, version 9.3 server
ii postgresql-9.3-postgis-2.2 2.2.2+dfsg-2~trusty1 amd64 Geographic objects support for PostgreSQL 9.3
ii postgresql-9.3-postgis-scripts 2.2.2+dfsg-2~trusty1 all Geographic objects support for PostgreSQL 9.3 -- scripts
ii postgresql-client-9.3 9.3.24-0ubuntu0.14.04 amd64 front-end programs for PostgreSQL 9.3
ii postgresql-client-common 154ubuntu1.1 all manager for multiple PostgreSQL client versions
ii postgresql-common 154ubuntu1.1 all PostgreSQL database-cluster manager
ii postgresql-contrib-9.3 9.3.24-0ubuntu0.14.04 amd64 additional facilities for PostgreSQL
ii libapache2-mod-php5 5.5.9+dfsg-1ubuntu4.27 amd64 server-side, HTML-embedded scripting language (Apache 2 module)
ii php5 5.5.9+dfsg-1ubuntu4.27 all server-side, HTML-embedded scripting language (metapackage)
ii php5-cgi 5.5.9+dfsg-1ubuntu4.27 amd64 server-side, HTML-embedded scripting language (CGI binary)
ii php5-cli 5.5.9+dfsg-1ubuntu4.27 amd64 command-line interpreter for the php5 scripting language
ii php5-common 5.5.9+dfsg-1ubuntu4.27 amd64 Common files for packages built from the php5 source
ii php5-curl 5.5.9+dfsg-1ubuntu4.27 amd64 CURL module for php5
ii php5-dev 5.5.9+dfsg-1ubuntu4.26 amd64 Files for PHP5 module development
ii php5-fpm 5.5.9+dfsg-1ubuntu4.27 amd64 server-side, HTML-embedded scripting language (FPM-CGI binary)
ii php5-json 1.3.2-2build1 amd64 JSON module for php5
ii php5-pgsql 5.5.9+dfsg-1ubuntu4.27 amd64 PostgreSQL module for php5
ii apache2 2.4.7-1ubuntu4.21 amd64 Apache HTTP Server
ii apache2-bin 2.4.7-1ubuntu4.21 amd64 Apache HTTP Server (binary files and modules)
ii apache2-data 2.4.7-1ubuntu4.21 all Apache HTTP Server (common files)
ii apache2-dev 2.4.7-1ubuntu4.21 amd64 Apache HTTP Server (development headers)
ii apache2-mpm-prefork 2.4.7-1ubuntu4.21 amd64 transitional prefork MPM package for apache2
ii apache2-mpm-worker 2.4.7-1ubuntu4.21 amd64 transitional worker MPM package for apache2
ii apache2-utils 2.4.7-1ubuntu4.21 amd64 Apache HTTP Server (utility programs for web servers)
ii libapache2-mod-auth-pgsql 2.0.3-6ubuntu0.1 amd64 Module for Apache2 which provides PostgreSQL authentication
ii libapache2-mod-fastcgi 2.4.7~0910052141-1.1 amd64 Apache 2 FastCGI module for long-running CGI scripts
ii libapache2-mod-mapcache 1.6.1-1~trusty0 amd64 tile caching server - Apache module
ii libapache2-mod-php5 5.5.9+dfsg-1ubuntu4.27 amd64 server-side, HTML-embedded scripting language (Apache 2 module)
ii globus-openssl-module-progs 3.3-2 amd64 Globus Toolkit - Globus OpenSSL Module Wrapper Programs
ii lcmaps-openssl-interface 1.6.1-2 all LCMAPS header files for OpenSSL interfaces
ii libcrypt-openssl-bignum-perl 0.04-4build1 amd64 Perl module to access OpenSSL multiprecision integer arithmetic libraries
ii libcrypt-openssl-dsa-perl 0.14-1 amd64 module which implements the DSA signature verification system
ii libcrypt-openssl-random-perl 0.04-1build6 amd64 Access to the OpenSSL pseudo-random number generator
ii libcrypt-openssl-rsa-perl 0.28-1build1 amd64 module for RSA encryption using OpenSSL
ii libcrypt-openssl-x509-perl 1.8.4-1 amd64 Perl extension to OpenSSL's X509 API
ii libcurl4-openssl-dev:amd64 7.35.0-1ubuntu2.20 amd64 development files and documentation for libcurl (OpenSSL flavour)
ii libengine-pkcs11-openssl 0.1.8-3 amd64 OpenSSL engine for PKCS#11 modules
ii libevent-openssl-2.0-5:amd64 2.0.21-stable-1ubuntu1.14.04.2 amd64 Asynchronous event notification library (openssl)
ii libglobus-gsi-openssl-error-dbg:amd64 2.1-5 amd64 Globus Toolkit - Globus OpenSSL Error Handling Debug Symbols
ii libglobus-gsi-openssl-error-dev:amd64 2.1-5 amd64 Globus Toolkit - Globus OpenSSL Error Handling Development Files
ii libglobus-gsi-openssl-error-doc 2.1-5 all Globus Toolkit - Globus OpenSSL Error Handling Documentation Files
ii libglobus-gsi-openssl-error0:amd64 2.1-5 amd64 Globus Toolkit - Globus OpenSSL Error Handling
ii libglobus-openssl-module-dbg:amd64 3.3-2 amd64 Globus Toolkit - Globus OpenSSL Module Wrapper Debug Symbols
ii libglobus-openssl-module-dev:amd64 3.3-2 amd64 Globus Toolkit - Globus OpenSSL Module Wrapper Development Files
ii libglobus-openssl-module-doc 3.3-2 all Globus Toolkit - Globus OpenSSL Module Wrapper Documentation Files
ii libglobus-openssl-module0:amd64 3.3-2 amd64 Globus Toolkit - Globus OpenSSL Module Wrapper
ii libgnutls-openssl27:amd64 2.12.23-12ubuntu2.8 amd64 GNU TLS library - OpenSSL wrapper
ii libpathfinder-openssl-1 1.1.3-0.4 amd64 Pathfinder integration Library for OpenSSL
ii libxmlsec1-openssl 1.2.18-2ubuntu1 amd64 Openssl engine for the XML security library
ii openssl 1.0.1f-1ubuntu2.27 amd64 Secure Sockets Layer toolkit - cryptographic utility
ii openssl-blacklist 0.5-3 all Blacklists for OpenSSL RSA keys and tools
ii openssl-blacklist-extra 0.5-3 all Non-default blacklists of OpenSSL RSA keys
ii python-openssl 0.13-2ubuntu6 amd64 Python 2 wrapper around the OpenSSL library
ii python-openssl-dbg 0.13-2ubuntu6 amd64 Python 2 wrapper around the OpenSSL library (debug extension)
ii python-openssl-doc 0.13-2ubuntu6 all Python wrapper around the OpenSSL library (documentation package)
ii python3-openssl 0.13-2ubuntu6 amd64 Python 3 wrapper around the OpenSSL library
ii python3-openssl-dbg 0.13-2ubuntu6 amd64 Python 3 wrapper around the OpenSSL library (debug extension)
ii strongswan-plugin-openssl 5.1.2-0ubuntu2.11 amd64 strongSwan plugin for OpenSSL

PHP GD library is NOT installed but it has been enabled actually

I have PHP GD installed and enabled:
sudo gedit /etc/php/7.0/apache2/php.ini
;extension=php_bz2.dll
extension=php_curl.dll
;extension=php_fileinfo.dll
;extension=php_ftp.dll
extension=php_gd2.dll
But I cannot find it on the phpinfo(); screen, nor can I find it using the code below:
if (extension_loaded('gd') && function_exists('gd_info')) {
echo "PHP GD library is installed on your web server";
}
else {
echo "PHP GD library is NOT installed on your web server";
}
Result: PHP GD library is NOT installed on your web server
I am on PHP 7.0:
$ php -v
PHP 7.0.22-0ubuntu0.17.04.1 (cli) (built: Aug 8 2017 22:03:30) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.22-0ubuntu0.17.04.1, Copyright (c) 1999-2017, by Zend Technologies
Any idea why and how I can fix it?
I am on Kubuntu 17.10 btw
If I go ahead installing it again:
$ sudo apt-get install php7.0-gd
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package php7.0-gd is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'php7.0-gd' has no installation candidate
Why??
EDIT 1:
$ sudo apt-get install php-gd
Reading package lists... Done
Building dependency tree
Reading state information... Done
php-gd is already the newest version (1:7.1+54ubuntu1).
0 to upgrade, 0 to newly install, 0 to remove and 86 not to upgrade.
EDIT 2:
But there is something strange - I am on PHP 7.0 but the GD below is php7.1-gd,
$ sudo apt-cache search php7-*
libapache2-mod-php7.1 - server-side, HTML-embedded scripting language (Apache 2 module)
php-all-dev - package depending on all supported PHP development packages
php7.1 - server-side, HTML-embedded scripting language (metapackage)
php7.1-cgi - server-side, HTML-embedded scripting language (CGI binary)
php7.1-cli - command-line interpreter for the PHP scripting language
php7.1-common - documentation, examples and common module for PHP
php7.1-curl - CURL module for PHP
php7.1-dev - Files for PHP7.1 module development
php7.1-gd - GD module for PHP
php7.1-gmp - GMP module for PHP
php7.1-json - JSON module for PHP
php7.1-ldap - LDAP module for PHP
php7.1-mysql - MySQL module for PHP
php7.1-odbc - ODBC module for PHP
php7.1-opcache - Zend OpCache module for PHP
php7.1-pgsql - PostgreSQL module for PHP
php7.1-pspell - pspell module for PHP
php7.1-readline - readline module for PHP
php7.1-recode - recode module for PHP
php7.1-snmp - SNMP module for PHP
php7.1-sqlite3 - SQLite3 module for PHP
php7.1-tidy - tidy module for PHP
php7.1-xml - DOM, SimpleXML, WDDX, XML, and XSL module for PHP
php7.1-xmlrpc - XMLRPC-EPI module for PHP
libphp7.1-embed - HTML-embedded scripting language (Embedded SAPI library)
php-amqp - AMQP extension for PHP
php-apcu - APC User Cache for PHP
php-ds - PHP extension providing efficient data structures for PHP 7
php-gearman - PHP wrapper to libgearman
php-geoip - GeoIP module for PHP
php-gmagick - Provides a wrapper to the GraphicsMagick library
php-gnupg - PHP wrapper around the gpgme library
php-http - PECL HTTP module for PHP Extended HTTP Support
php-igbinary - igbinary PHP serializer
php-imagick - Provides a wrapper to the ImageMagick library
php-libsodium - PHP wrapper for the Sodium cryptographic library
php-mailparse - Email message manipulation for PHP
php-memcache - memcache extension module for PHP
php-memcached - memcached extension module for PHP, uses libmemcached
php-mongodb - MongoDB driver for PHP
php-msgpack - PHP extension for interfacing with MessagePack
php-oauth - OAuth 1.0 consumer and provider extension
php-pinba - Pinba module for PHP
php-propro - propro module for PHP
php-ps - ps module for PHP
php-radius - radius client library for PHP
php-raphf - raphf module for PHP
php-redis - PHP extension for interfacing with Redis
php-remctl - PECL module for Kerberos-authenticated command execution
php-rrd - PHP bindings to rrd tool system
php-sass - PHP bindings to libsass - fast, native Sass parsing in PHP
php-smbclient - PHP wrapper for libsmbclient
php-solr - PHP extension for communicating with Apache Solr server
php-ssh2 - Bindings for the libssh2 library
php-stomp - Streaming Text Oriented Messaging Protocol (STOMP) client module for PHP
php-symfony-polyfill-php70 - Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
php-tideways - Tideways PHP Profiler Extension
php-uploadprogress - file upload progress tracking extension for PHP
php-uuid - PHP UUID extension
php-xdebug - Xdebug Module for PHP
php-yac - YAC (Yet Another Cache) for PHP
php-yaml - YAML-1.1 parser and emitter for PHP
php-zmq - ZeroMQ messaging bindings for PHP
php7.1-bcmath - Bcmath module for PHP
php7.1-bz2 - bzip2 module for PHP
php7.1-dba - DBA module for PHP
php7.1-enchant - Enchant module for PHP
php7.1-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary)
php7.1-imap - IMAP module for PHP
php7.1-interbase - Interbase module for PHP
php7.1-intl - Internationalisation module for PHP
php7.1-mapi - Complete and feature rich groupware solution - PHP MAPI bindings
php7.1-mbstring - MBSTRING module for PHP
php7.1-mcrypt - libmcrypt module for PHP
php7.1-phpdbg - server-side, HTML-embedded scripting language (PHPDBG binary)
php7.1-soap - SOAP module for PHP
php7.1-sybase - Sybase module for PHP
php7.1-xsl - XSL module for PHP (dummy)
php7.1-zip - Zip module for PHP
php7cc - command line tool to detect PHP 7 incompatible code
php7.0-mysql - MySQL module for PHP
php7.0-readline - readline module for PHP
php7.0-opcache - Zend OpCache module for PHP
php7.0-mbstring - MBSTRING module for PHP
php7.0 - server-side, HTML-embedded scripting language (metapackage)
php7.0-cgi - server-side, HTML-embedded scripting language (CGI binary)
libapache2-mod-php7.0 - server-side, HTML-embedded scripting language (Apache 2 module)
php7.0-mcrypt - libmcrypt module for PHP
php7.0-curl - CURL module for PHP
php7.0-cli - command-line interpreter for the PHP scripting language
php7.0-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary)
php7.0-xmlrpc - XMLRPC-EPI module for PHP
php7.0-json - JSON module for PHP
php7.0-common - documentation, examples and common module for PHP
php7.0-xml - DOM, SimpleXML, WDDX, XML, and XSL module for PHP
Is this causing the problem? Should I uninstall php7.1-gd?
I finally got it working following these 3 steps:
uninstalled PHP and all its libs from my machine following this answer.
upgraded Ubuntu to 18.04 following this guide.
installed PHP 7.2 following this guide.*
On my terminal:
$ sudo apt-get install php
$ sudo apt-get install php-pear php-fpm php-dev php-zip php-curl php-xmlrpc php-gd php-mysql php-mbstring php-xml libapache2-mod-php
$ php -v
PHP 7.2.5-0ubuntu0.18.04.1 (cli) (built: May 9 2018 17:21:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.5-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies
$ sudo systemctl restart apache2
Result:
It took a few hours but worth it!

GD image library not loaded, Ubuntu 14.04

My Drupal installations are complaining over missing GD library:
GD library rotate and desaturate effects
The GD library for PHP is missing or outdated. Check the PHP image documentation for information on how to correct this.
However I have installed the gd package with
sudo apt-get install php5-gd
and restarted Apache several times.
It shows over the list of installed packages:
Packages:
dpkg -l|grep php
ii libapache2-mod-php5 5.5.9+dfsg-1ubuntu4.14 amd64 server-side, HTML-embedded scripting language (Apache 2 module)
ii php-pear 5.5.9+dfsg-1ubuntu4.14 all PEAR - PHP Extension and Application Repository
ii php5 5.5.9+dfsg-1ubuntu4.14 all server-side, HTML-embedded scripting language (metapackage)
ii php5-cgi 5.5.9+dfsg-1ubuntu4.14 amd64 server-side, HTML-embedded scripting language (CGI binary)
ii php5-cli 5.5.9+dfsg-1ubuntu4.14 amd64 command-line interpreter for the php5 scripting language
ii php5-common 5.5.9+dfsg-1ubuntu4.14 amd64 Common files for packages built from the php5 source
ii php5-gd 5.5.9+dfsg-1ubuntu4.14 amd64 GD module for php5
ii php5-json 1.3.2-2build1 amd64 JSON module for php5
ii php5-mysql 5.5.9+dfsg-1ubuntu4.14 amd64 MySQL module for php5
ii php5-readline 5.5.9+dfsg-1ubuntu4.14 amd64 Readline module for php5
When trying to add the library manually to a php.ini file with
extension=ge.so;
I get this warning:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/ge.so' - /usr/lib/php5/20121212/ge.so: cannot open shared object file: No such file or directory in Unknown on line 0
Server has been installed with Virtualmin GPL
Ubuntu 14.04.3 LTS
PHP version:
PHP 5.5.9-1ubuntu4.14
Any advice very appreciated!

Categories