0

How to install packages php7.2-hash php7.2-openssl php7.2-pdo_mysql if they are not found by apt.

php7.2-hash php7.2-openssl php7.2-pdo_mysql

root@sample:~# apt install php7.2-hash 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package php7.2-hash
E: Couldn't find any package by glob 'php7.2-hash'
E: Couldn't find any package by regex 'php7.2-hash'
root@sample:~# apt install php7.2-openssl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package php7.2-openssl
E: Couldn't find any package by glob 'php7.2-openssl'
E: Couldn't find any package by regex 'php7.2-openssl'
root@sample:~# apt install php7.2-pdo_mysql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package php7.2-pdo_mysql
E: Couldn't find any package by glob 'php7.2-pdo_mysql'
E: Couldn't find any package by regex 'php7.2-pdo_mysql'
0

Hash

Hash is not PHP library. As of PHP 5.1.2, the Hash extension is bundled and compiled into PHP by default. (source)

To check if hash is enabled in your PHP, you can run

$ php -i | grep -i hash

You will see something similar to

hash
hash support => enabled
Hashing Engines => md2 md4 md5 sha1 sha224 sha256 sha384 sha512/224 sha512/256 sha512 sha3-224 sha3-256 sha3-384 sha3-512 ripemd128 ripemd160 ripemd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru snefru256 gost gost-crypto adler32 crc32 crc32b crc32c fnv132 fnv1a32 fnv164 fnv1a64 joaat haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5 
MHASH support => Enabled
MHASH API Version => Emulated Support
phar.require_hash => On => On

OpenSSL

OpenSSL is not PHP library. If you need openssl support, you have to install OpenSSL in your system.

$ sudo apt install openssl

To check if openssl is enabled in your PHP, you can run

$ php -i | grep -i openssl

You will see something similar to

SSL Version => OpenSSL/1.1.1f
libSSH Version => libssh/0.9.3/openssl/zlib
openssl
OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 1.1.1f  31 Mar 2020
OpenSSL Header Version => OpenSSL 1.1.1f  31 Mar 2020
Openssl default config => /usr/lib/ssl/openssl.cnf
openssl.cafile => no value => no value
openssl.capath => no value => no value
Native OpenSSL support => enabled

PDO: MySQL

PDO and the PDO_SQLITE driver is enabled by default as of PHP 5.1.0. You may need to enable the PDO driver for your database of choice; consult the documentation for database-specific PDO drivers to find out more about that. (source)

If you want to enable PDO: MySQL, you have to install MySQL and php-mysql in your system.

$ sudo apt install mysql-server php-mysql

To check if PDO for MySQL is enabled in your PHP, you can run

$ php -i | grep -i pdo

You will see something similar to

/etc/php/7.4/cli/conf.d/10-pdo.ini,
/etc/php/7.4/cli/conf.d/20-pdo_mysql.ini,
/etc/php/7.4/cli/conf.d/20-pdo_sqlite.ini,
API Extensions => mysqli,pdo_mysql
PDO
PDO support => enabled
PDO drivers => mysql, sqlite
pdo_mysql
PDO Driver for MySQL => enabled
pdo_mysql.default_socket => /var/run/mysqld/mysqld.sock => /var/run/mysqld/mysqld.sock
pdo_sqlite
PDO Driver for SQLite 3.x => enabled
| improve this answer | |

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.