How do I install PHP 8.2 openssl package?

I tried to install openssl extension for php with pacman, but both php-openssl and php82-openssl are not found. How can I install it?

PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_pgsql' (tried: /usr/lib/php/modules/pdo_pgsql (/usr/lib/php/modules/pdo_pgsql: cannot open shared object file: No such file or directory), /usr/lib/php/modules/pdo_pgsql.so (/usr/lib/php/modules/pdo_pgsql.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'openssl' (tried: /usr/lib/php/modules/openssl (/usr/lib/php/modules/openssl: cannot open shared object file: No such file or directory), /usr/lib/php/modules/openssl.so (/usr/lib/php/modules/openssl.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'phar' (tried: /usr/lib/php/modules/phar (/usr/lib/php/modules/phar: cannot open shared object file: No such file or directory), /usr/lib/php/modules/phar.so (/usr/lib/php/modules/phar.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Do you actually need it?

You could install from the AUR: AUR (en) - php82

Edit: You don’t need this package. Openssl should be included in the repo version of php82.

I need it for “openssl_encrypt”. How do I install something from AUR? Should I clone the repo and compile it or is it something trivial like pacman?

Never mind I found it.

Just search the database:

pamac search -f pdo_pgsql

@mithrial php82 is the current php version. AUR not needed.

That is the most helpful message on a public forum, where a lot of people search. Don’t you think?

I cannot post links. Probably my account is too new.

I installed it from AUR and copied the extension to the modules of the php 8.2 I use.
cp /usr/lib/php82/modules/openssl.so /usr/lib/php/modules

So far it appears to work, but I haven’t tried with code yet, it is just loaded as openssl. Maybe I’ll have to set the Apache to use the php82 installed from AUR.

Well, I don’t how old your php script is, but since php7 openssl should be builtin.

php -m
php -i | grep ssl

Same for phar. Only needed external module would be pdo_pgsql.

The AUR version requires an external module because the main version php82 does not include openssl on build time. It is a pretty basic build. That is whole reason for that package on the AUR.