Создание скрипта на PostgreSQL в окружении ALT Linux можно выполнить через SQL файла или непосредственно в командной строке. Вот пошаговое руководство по созданию и выполнению простого скрипта:
1. Установка PostgreSQL
User
PHP Data Objects на alt linux
Assistant
User
[root@d-postg-test pochta_ka]# sudo apt-get install php php-cli php-pdo php-pgsql
Чтение списков пакетов... Завершено
Построение дерева зависимостей... Завершено
Виртуальный пакет php предоставляется следующими пакетами:
php8.2 p10+369829.100.4.1@1737376207
php8.1 p10+363828.100.1.1@1733133466
php8.0 p10+329785.100.2.1@1695219366
php7 p10+309489.100.1.1@1667544977
Необходимо точно указать, какой из пакетов должен быть установлен.
Assistant
Сообщение, которое вы получили, указывает на то, что вам необходимо выбрать конкретную версию PHP для установки, поскольку у вас установлены несколько версий PHP в вашем репозитории.
Чтобы установить PHP с использованием apt-get, выполните следующие шаги:
Выберите версию PHP: Для начала вам нужно определить, какая версия PHP вам нужна. Наиболее актуальные и поддерживаемые версии на данный момент - это PHP 8.2, PHP 8.1 и PHP 8.0. Выберите ту, которая вам подходит, или если не уверены, рекомендую установить последнюю стабильную версию (например, 8.2).
Установка конкретной версии: Выполните команду с указанием конкретной версии. Например, чтобы установить PHP 8.2 и его модули для работы с PostgreSQL:
Для установки других версий просто замените на желаемую версию, например или .
User
[root@d-postg-test pochta_ka]# sudo apt-get install php8.2 php8.2-cli php8.2-pdo php8.2-pgsql
Чтение списков пакетов... Завершено
Построение дерева зависимостей... Завершено
E: Невозможно найти пакет php8.2-cli
Assistant
Сообщение об ошибке указывает на то, что пакет php8.2-cli не удается найти в ваших репозиториях. Возможные причины могут включать отсутствие репозитория для PHP 8.2 или использование нестандартного дистрибутива, который не поддерживает эту версию.
Вот несколько шагов, которые можно предпринять для решения проблемы:
1. Обновите список пакетов
Прежде чем устанавливать пакеты, убедитесь, что ваш список пакетов обновлён:
User
Assistant
Судя по вашему выводу, у вас есть несколько версий PHP, включая 7, 8.0, 8.1 и 8.2, но нет пакета php8.2-cli, что вполне возможно из-за особенностей вашего дистрибутива или репозитория.
Вы можете установить более доступные версии PHP и их модули. По вашему выводу, у вас имеются соответствующие модули для версии PHP 8.1 и 8.2, такие как php8.1-pdo и php8.2-pdo. Попробуйте установить пакеты для другой версии PHP:
Вот шаги для установки PHP 8.2 и нужных вам модулей:
Установка PHP 8.2 и модулей
Установите PHP 8.2:
Если PostgreSQL еще не установлен, его можно установить с помощью пакетного менеджера apt или dnf, в зависимости от версии вашего дистрибутива ALT Linux.
По умолчанию PostgreSQL создает пользователя с именем postgres. Вам потребуется переключиться на этого пользователя для выполнения команд:
sudo -i -u postgres
3. Создание базы данных и пользователя
Войдите в консоль PostgreSQL:
psql
Создайте новую базу данных и пользователя:
CREATE DATABASE mydb;
CREATE USER myuser WITH ENCRYPTED PASSWORD 'mypassword';
GRANT ALL PRIVILEGES ON DATABASE mydb TO myuser;
4. Создание SQL скрипта
Создайте файл с вашим SQL скриптом, например script.sql. В этом файле вы можете прописать все необходимые команды для работы с вашим проектом. Пример простого скрипта:
-- script.sql
CREATE TABLE users (
id SERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
email VARCHAR(100) NOT NULL UNIQUE
);
INSERT INTO users (name, email) VALUES ('John Doe', 'john@example.com');
INSERT INTO users (name, email) VALUES ('Jane Smith', 'jane@example.com');
5. Выполнение SQL скрипта
Вы можете выполнить созданный скрипт с помощью команды psql. Выйдите из консоли PostgreSQL (\q), если вы еще внутри нее, и выполните следующую команду:
psql -U myuser -d mydb -f /путь/к/script.sql
Замените /путь/к/ на фактический путь к вашему скрипту.
6. Проверьте результат
Войдите снова в консоль psql под своим пользователем и проверьте, что таблица была создана и данные вставлены:
psql -U myuser -d mydb
SELECT * FROM users;
Это базовые шаги для создания и выполнения SQL скрипта в PostgreSQL на ALT Linux. Если вам нужны дополнительные функции или есть особые требования, дайте знать!
PHP Data Objects (PDO) — это интерфейс для доступа к базам данных в PHP, который предоставляет единый способ работы с различными СУБД. Для того, чтобы использовать PDO на ALT Linux, вам необходимо убедиться, что у вас установлен PHP и нужные расширения.
Шаги по установке и настройке PDO на ALT Linux
Установка PHP:
Если PHP еще не установлен, его можно установить с помощью пакетного менеджера. В зависимости от вашей версии ALT Linux это может быть apt или dnf. Пример для установки PHP:
Обратите внимание, что для работы с PostgreSQL вам может понадобиться расширение php-pgsql. Если вы используете другую СУБД (например, MySQL), вам нужно будет установить php-mysql.
Проверка установки:
После установки можно проверить, что PHP и PDO установлены правильно, выполнив команду:
php -m | grep -i pdo
Это должно вывести что-то вроде:
pdo
pdo_pgsql
Если вы используете MySQL, вместо pdo_pgsql должно быть pdo_mysql.
Создание простого скрипта на PHP с использованием PDO:
Создайте файл, например test_pdo.php, и добавьте в него следующий код:
Не забудьте заменить параметры соединения (имя базы данных, пользователь и пароль) на ваши.
Запуск скрипта:
Чтобы запустить скрипт, выполните команду:
php test_pdo.php
Если все настроено правильно, вы должны увидеть сообщение "Соединение установлено!".
Дополнительные советы
Управление зависимостями: Если вы планируете использовать Composer, вам нужно установить composer. Это позволит вам управлять зависимостями и библиотеками для вашего проекта.
Расширения: Убедитесь, что все нужные вам расширения для работы с вашей базой данных установлены. Вы можете просмотреть доступные расширения, используя следующую команду:
php -m
Документация: Ознакомьтесь с официальной документацией PDO на php.net для получения более подробной информации о функциональных возможностях и примерах.
Если у вас есть другие вопросы или вам нужна помощь с конкретной задачей, не стесняйтесь обращаться!
8.2
8.1
8.0
Проверка установки: После завершения установки вы можете проверить, что PHP и необходимые расширения установлены, выполнив команду:
php -m | grep -i pdo
Создание PHP-скрипта для тестирования: Используйте код, который был предложен ранее, чтобы протестировать соединение с базой данных.
Если вам нужно больше информации о других пакетах или версиях PHP, вы можете выполнить:
apt-cache search php | grep php
Это даст вам список доступных пакетов PHP, которые вы можете установить.
sudo apt-get update
2. Проверьте доступные версии PHP
Вы можете просмотреть доступные версии PHP, выполнив команду:
apt-cache search php | grep php
Это покажет вам доступные пакеты PHP. Если php8.2 не отображается, возможно, у вас нет нужного репозитория.
3. Установка репозитория для PHP
Если ваша система не имеет необходимых репозиториев для PHP, вы можете добавить их вручную. Для этого используйте add-apt-repository. Например, для установки PHP 8.2 вы можете использовать репозиторий ondrej/php, который часто используется для установки более новых версий PHP:
Если установка все еще не удается, проверьте наличие ошибок или предупреждений, которые могут указывать на проблемы с зависимостями или версиями пакетов.
Если у вас есть доступ к интернету, вы также можете обратиться к документации вашего дистрибутива для получения информации о поддерживаемых версиях PHP и пакетах.
Если у вас по-прежнему возникают проблемы, пожалуйста, предоставьте мне больше информации о вашем дистрибутиве, и я постараюсь помочь!
[root@d-postg-test pochta_ka]# apt-cache search php | grep php
apache2-mod_php7 - The php HTML-embedded scripting language for use with Apache2
apache2-mod_php8.0 - The php HTML-embedded scripting language for use with Apache2
apache2-mod_php8.1 - The php HTML-embedded scripting language for use with Apache2
apache2-mod_php8.2 - The php HTML-embedded scripting language for use with Apache2
gambit-devel-php - Development files for Gambit Scheme (PHP backend)
php7-lasso - Liberty Alliance Single Sign On (lasso) PHP bindings
php-base - Package with common data for various PHP packages
php7 - The PHP7 scripting language
php7-devel - Development package for PHP7
php7-libs - Package with common data for various PHP7 packages
php7-mysqlnd - Native PHP driver for MySQL
php7-apcu - PHP extension APCu - APC User Cache
php7-apcu_bc - PHP7 extension apcu_bc - APCu Backwards Compatibility Module
php7-bz2 - A Bzip2 management extension
php7-calendar - Date conversion between different calendar formats
php7-curl - CURL extension for PHP
php7-dba - DBA (gdbm, db4) module for PHP
php7-enchant - Enchant functions
php7-exif - Read header information from JPEG and DIFF headers
php7-fileinfo - Fileinfo PHP extension try to guess the content type and encoding of a file
php7-fpm-fcgi - The PHP HTML-embedded scripting language as a php-fpm (FastCGI) binary.
php7-gd - GD library support for PHP
php7-geoip - Map IP address to geographic places
php7-gmagick - php extension to work with images using the GraphicsMagick API
php7-gmp - GNU MP support for PHP
php7-http - Extended HTTP Support
php7-http-devel - Development package for php7-http
php7-imagick - PHP wrapper to the ImageMagick library
php7-imap - IMAP module for PHP
php7-intl - Internationalization extension is a wrapper for ICU library
php7-krb5 - PHP module for authentication via GSSAPI
php7-ldap - LDAP module for PHP
php7-mbstring - PHP module for support multi-byte strings.
php7-mcrypt - Mcrypt library support for PHP
php7-memcache - memcached extension for php7
php7-memcached - php extension for interfacing with memcached via libmemcached library
php7-mysqlnd-mysqli - MySQL Improved Extension for PHP with Native Driver
php7-opcache - Zend Opcache extension for opcode caching and optimization
php7-openssl - OpenSSL module for php
php7-pcntl - Process Control Module for PHP (pcntl)
php7-pdo - PHP Data Objects Interface
php7-pdo_mysql - MySQL driver for PHP Data Objects Interface
php7-pdo_odbc - ODBC driver for PHP Data Objects Interface
php7-pdo_pgsql - PostgreSQL driver for PHP Data Objects Interface
php7-pdo_sqlite - SQLLite v3 driver for PHP Data Objects Interface
php7-pdo_sqlsrv - Microsoft Drivers for PHP PDO for SQL Server
php7-pgsql - PostgreSQL database module for PHP
php7-propro - Property proxy
php7-propro-devel - Development package for php7-propro
php7-raphf - Resource and persistent handles factory
php7-raphf-devel - Development package for php7-raphf
php7-readline - Readline functions
php7-redis - Client extension for Redis key-value store
php7-smbclient - A PHP wrapper for libsmbclient
php7-snmp - SNMP module for PHP
php7-soap - Provides SOAP Services for PHP
php7-sockets - Sockets support for PHP
php7-sodium - Sodium library support for PHP
php7-sphinx - PHP bindings for Sphinx search client library
php7-sqlsrv - Microsoft Drivers for PHP for SQL Server
php7-ssh2 - PHP bindings for the libssh2 library
php7-swoole - Coroutine-based concurrency library for PHP
php7-tidy - PHP binding for the Tidy HTML clean and repair utility
php7-xdebug - xdebug extensions
php7-xhprof - PHP hierarchical profiler
php7-xmlreader - PHP module for support XML
php7-xmlrpc - PHP module to write XML-RPC servers and clients
php7-xsl - Sablotron XSLT support for PHP
php7-yaml - PHP5 YAML-1.1 parser and emitter
php7-zip - ZIP functions
php8.0 - The PHP scripting language
php8.0-devel - Development package for PHP7
php8.0-libs - Package with common data for various PHP packages
php8.0-mysqlnd - Native PHP driver for MySQL
php8.0-apcu - PHP extension APCu - APC User Cache
php8.0-bz2 - A Bzip2 management extension
php8.0-calendar - Date conversion between different calendar formats
php8.0-cgi - The PHP HTML-embedded scripting language as a CGI (FastCGI) binary.
php8.0-curl - CURL extension for PHP
php8.0-dba - DBA (gdbm, db4) module for PHP
php8.0-exif - Read header information from JPEG and DIFF headers
php8.0-fileinfo - Fileinfo PHP extension try to guess the content type and encoding of a file
php8.0-fpm-fcgi - The PHP HTML-embedded scripting language as a php-fpm (FastCGI) binary.
php8.0-gd - GD library support for PHP
php8.0-gmagick - php extension to work with images using the GraphicsMagick API
php8.0-gmp - GNU MP support for PHP
php8.0-igbinary - Replacement for the standard PHP serializer
php8.0-igbinary-devel - Igbinary developer files (header)
php8.0-imagick - PHP wrapper to the ImageMagick library
php8.0-imap - IMAP module for PHP
php8.0-intl - Internationalization extension is a wrapper for ICU library
php8.0-ldap - LDAP module for PHP
php8.0-mbstring - PHP module for support multi-byte strings.
php8.0-mcrypt - Mcrypt library support for PHP
php8.0-memcache - memcached extension for php8.0
php8.0-memcached - php extension for interfacing with memcached via libmemcached library
php8.0-mysqlnd-mysqli - MySQL Improved Extension for PHP with Native Driver
php8.0-opcache - Zend Opcache extension for opcode caching and optimization
php8.0-openssl - OpenSSL module for php
php8.0-pcntl - Process Control Module for PHP (pcntl)
php8.0-pdo - PHP Data Objects Interface
php8.0-pdo_mysql - MySQL driver for PHP Data Objects Interface
php8.0-pdo_odbc - ODBC driver for PHP Data Objects Interface
php8.0-pdo_pgsql - PostgreSQL driver for PHP Data Objects Interface
php8.0-pdo_sqlite - SQLLite v3 driver for PHP Data Objects Interface
php8.0-pdo_sqlsrv - Microsoft Drivers for PHP PDO for SQL Server
php8.0-pgsql - PostgreSQL database module for PHP
php8.0-readline - Readline functions
php8.0-redis - Client extension for Redis key-value store
php8.0-smbclient - A PHP wrapper for libsmbclient
php8.0-snmp - SNMP module for PHP
php8.0-soap - Provides SOAP Services for PHP
php8.0-sockets - Sockets support for PHP
php8.0-sodium - Sodium library support for PHP
php8.0-sphinx - PHP bindings for Sphinx search client library
php8.0-sqlsrv - Microsoft Drivers for PHP for SQL Server
php8.0-ssh2 - PHP bindings for the libssh2 library
php8.0-swoole - Coroutine-based concurrency library for PHP
php8.0-tidy - PHP binding for the Tidy HTML clean and repair utility
php8.0-xdebug - xdebug extensions
php8.0-xhprof - PHP hierarchical profiler
php8.0-xmlreader - PHP module for support XML
php8.0-xmlrpc - PHP module to write XML-RPC servers and clients
php8.0-xsl - Sablotron XSLT support for PHP
php8.0-yaml - PHP5 YAML-1.1 parser and emitter
php8.0-zip - ZIP functions
php8.1 - The PHP scripting language
php8.1-devel - Development package for PHP7
php8.1-libs - Package with common data for various PHP packages
php8.1-mysqlnd - Native PHP driver for MySQL
php8.1-openssl - OpenSSL module for php
php8.1-amqp - PHP extension to communicate with any AMQP compliant server
php8.1-apcu - PHP extension APCu - APC User Cache
php8.1-ast - Extension exposing PHP 7 abstract syntax tree
php8.1-bz2 - A Bzip2 management extension
php8.1-calendar - Date conversion between different calendar formats
php8.1-cgi - The PHP HTML-embedded scripting language as a CGI (FastCGI) binary.
php8.1-curl - CURL extension for PHP
php8.1-dba - DBA (gdbm, db4) module for PHP
php8.1-exif - Read header information from JPEG and DIFF headers
php8.1-fileinfo - Fileinfo PHP extension try to guess the content type and encoding of a file
php8.1-fpm-fcgi - The PHP HTML-embedded scripting language as a php-fpm (FastCGI) binary.
php8.1-gd - GD library support for PHP
php8.1-gmagick - php extension to work with images using the GraphicsMagick API
php8.1-gmp - GNU MP support for PHP
php8.1-igbinary - Replacement for the standard PHP serializer
php8.1-igbinary-devel - Igbinary developer files (header)
php8.1-imagick - PHP wrapper to the ImageMagick library
php8.1-imap - IMAP module for PHP
php8.1-intl - Internationalization extension is a wrapper for ICU library
php8.1-ldap - LDAP module for PHP
php8.1-mbstring - PHP module for support multi-byte strings.
php8.1-mcrypt - Mcrypt library support for PHP
php8.1-memcache - memcached extension for php8.1
php8.1-memcached - php extension for interfacing with memcached via libmemcached library
php8.1-mysqlnd-mysqli - MySQL Improved Extension for PHP with Native Driver
php8.1-opcache - Zend Opcache extension for opcode caching and optimization
php8.1-pcntl - Process Control Module for PHP (pcntl)
php8.1-pdo - PHP Data Objects Interface
php8.1-pdo_mysql - MySQL driver for PHP Data Objects Interface
php8.1-pdo_odbc - ODBC driver for PHP Data Objects Interface
php8.1-pdo_pgsql - PostgreSQL driver for PHP Data Objects Interface
php8.1-pdo_sqlite - SQLLite v3 driver for PHP Data Objects Interface
php8.1-pdo_sqlsrv - Microsoft Drivers for PHP PDO for SQL Server
php8.1-pgsql - PostgreSQL database module for PHP
php8.1-readline - Readline functions
php8.1-redis - Client extension for Redis key-value store
php8.1-smbclient - A PHP wrapper for libsmbclient
php8.1-snmp - SNMP module for PHP
php8.1-soap - Provides SOAP Services for PHP
php8.1-sockets - Sockets support for PHP
php8.1-sodium - Sodium library support for PHP
php8.1-sphinx - PHP bindings for Sphinx search client library
php8.1-sqlsrv - Microsoft Drivers for PHP for SQL Server
php8.1-ssh2 - PHP bindings for the libssh2 library
php8.1-swoole - Coroutine-based concurrency library for PHP
php8.1-tidy - PHP binding for the Tidy HTML clean and repair utility
php8.1-xdebug - xdebug extensions
php8.1-xhprof - PHP hierarchical profiler
php8.1-xmlreader - PHP module for support XML
php8.1-xmlrpc - PHP module to write XML-RPC servers and clients
php8.1-xsl - Sablotron XSLT support for PHP
php8.1-yaml - PHP5 YAML-1.1 parser and emitter
php8.1-zip - ZIP functions
php8.2 - The PHP scripting language
php8.2-devel - Development package for PHP
php8.2-libs - Package with common data for various PHP packages
php8.2-mysqlnd - Native PHP driver for MySQL
php8.2-openssl - OpenSSL module for php
php8.2-amqp - PHP extension to communicate with any AMQP compliant server
php8.2-apcu - PHP extension APCu - APC User Cache
php8.2-ast - Extension exposing PHP 7 abstract syntax tree
php8.2-bz2 - A Bzip2 management extension
php8.2-calendar - Date conversion between different calendar formats
php8.2-cgi - The PHP HTML-embedded scripting language as a CGI (FastCGI) binary.
php8.2-curl - CURL extension for PHP
php8.2-dba - DBA (gdbm, db4) module for PHP
php8.2-exif - Read header information from JPEG and DIFF headers
php8.2-fileinfo - Fileinfo PHP extension try to guess the content type and encoding of a file
php8.2-fpm-fcgi - The PHP HTML-embedded scripting language as a php-fpm (FastCGI) binary.
php8.2-gd - GD library support for PHP
php8.2-gmagick - php extension to work with images using the GraphicsMagick API
php8.2-gmp - GNU MP support for PHP
php8.2-igbinary - Replacement for the standard PHP serializer
php8.2-igbinary-devel - Igbinary developer files (header)
php8.2-imagick - PHP wrapper to the ImageMagick library
php8.2-imap - IMAP module for PHP
php8.2-intl - Internationalization extension is a wrapper for ICU library
php8.2-ldap - LDAP module for PHP
php8.2-mbstring - PHP module for support multi-byte strings.
php8.2-mcrypt - Mcrypt library support for PHP
php8.2-memcache - memcached extension for php8.2
php8.2-memcached - php extension for interfacing with memcached via libmemcached library
php8.2-mysqlnd-mysqli - MySQL Improved Extension for PHP with Native Driver
php8.2-opcache - Zend Opcache extension for opcode caching and optimization
php8.2-pcntl - Process Control Module for PHP (pcntl)
php8.2-pdo - PHP Data Objects Interface
php8.2-pdo_mysql - MySQL driver for PHP Data Objects Interface
php8.2-pdo_odbc - ODBC driver for PHP Data Objects Interface
php8.2-pdo_pgsql - PostgreSQL driver for PHP Data Objects Interface
php8.2-pdo_sqlite - SQLLite v3 driver for PHP Data Objects Interface
php8.2-pdo_sqlsrv - Microsoft Drivers for PHP PDO for SQL Server
php8.2-pgsql - PostgreSQL database module for PHP
php8.2-readline - Readline functions
php8.2-redis - Client extension for Redis key-value store
php8.2-smbclient - A PHP wrapper for libsmbclient
php8.2-snmp - SNMP module for PHP
php8.2-soap - Provides SOAP Services for PHP
php8.2-sockets - Sockets support for PHP
php8.2-sodium - Sodium library support for PHP
php8.2-sphinx - PHP bindings for Sphinx search client library
php8.2-sqlsrv - Microsoft Drivers for PHP for SQL Server
php8.2-ssh2 - PHP bindings for the libssh2 library
php8.2-swoole - Coroutine-based concurrency library for PHP
php8.2-tidy - PHP binding for the Tidy HTML clean and repair utility
php8.2-xdebug - xdebug extensions
php8.2-xhprof - PHP hierarchical profiler
php8.2-xmlreader - PHP module for support XML
php8.2-xmlrpc - PHP module to write XML-RPC servers and clients
php8.2-xsl - Sablotron XSLT support for PHP
php8.2-yaml - PHP5 YAML-1.1 parser and emitter
php8.2-zip - ZIP functions
unit-php - PHP module for NGINX Unit
i586-apache2-mod_php7 - The php HTML-embedded scripting language for use with Apache2
i586-apache2-mod_php8.0 - The php HTML-embedded scripting language for use with Apache2
i586-apache2-mod_php8.1 - The php HTML-embedded scripting language for use with Apache2
i586-apache2-mod_php8.2 - The php HTML-embedded scripting language for use with Apache2
i586-php7-apcu - PHP extension APCu - APC User Cache
i586-php7-apcu_bc - PHP7 extension apcu_bc - APCu Backwards Compatibility Module
i586-php7-bz2 - A Bzip2 management extension
i586-php7-calendar - Date conversion between different calendar formats
i586-php7-curl - CURL extension for PHP
i586-php7-dba - DBA (gdbm, db4) module for PHP
i586-php7-enchant - Enchant functions
i586-php7-exif - Read header information from JPEG and DIFF headers
i586-php7-fileinfo - Fileinfo PHP extension try to guess the content type and encoding of a file
i586-php7-gd - GD library support for PHP
i586-php7-geoip - Map IP address to geographic places
i586-php7-gmagick - php extension to work with images using the GraphicsMagick API
i586-php7-gmp - GNU MP support for PHP
i586-php7-http - Extended HTTP Support
i586-php7-imagick - PHP wrapper to the ImageMagick library
i586-php7-imap - IMAP module for PHP
i586-php7-intl - Internationalization extension is a wrapper for ICU library
i586-php7-krb5 - PHP module for authentication via GSSAPI
i586-php7-lasso - Liberty Alliance Single Sign On (lasso) PHP bindings
i586-php7-ldap - LDAP module for PHP
i586-php7-libs - Package with common data for various PHP7 packages
i586-php7-mbstring - PHP module for support multi-byte strings.
i586-php7-mcrypt - Mcrypt library support for PHP
i586-php7-memcache - memcached extension for php7
i586-php7-memcached - php extension for interfacing with memcached via libmemcached library
i586-php7-mysqlnd - Native PHP driver for MySQL
i586-php7-mysqlnd-mysqli - MySQL Improved Extension for PHP with Native Driver
i586-php7-opcache - Zend Opcache extension for opcode caching and optimization
i586-php7-openssl - OpenSSL module for php
i586-php7-pcntl - Process Control Module for PHP (pcntl)
i586-php7-pdo - PHP Data Objects Interface
i586-php7-pdo_mysql - MySQL driver for PHP Data Objects Interface
i586-php7-pdo_odbc - ODBC driver for PHP Data Objects Interface
i586-php7-pdo_pgsql - PostgreSQL driver for PHP Data Objects Interface
i586-php7-pdo_sqlite - SQLLite v3 driver for PHP Data Objects Interface
i586-php7-pgsql - PostgreSQL database module for PHP
i586-php7-propro - Property proxy
i586-php7-raphf - Resource and persistent handles factory
i586-php7-readline - Readline functions
i586-php7-redis - Client extension for Redis key-value store
i586-php7-smbclient - A PHP wrapper for libsmbclient
i586-php7-snmp - SNMP module for PHP
i586-php7-soap - Provides SOAP Services for PHP
i586-php7-sockets - Sockets support for PHP
i586-php7-sodium - Sodium library support for PHP
i586-php7-sphinx - PHP bindings for Sphinx search client library
i586-php7-ssh2 - PHP bindings for the libssh2 library
i586-php7-swoole - Coroutine-based concurrency library for PHP
i586-php7-tidy - PHP binding for the Tidy HTML clean and repair utility
i586-php7-xdebug - xdebug extensions
i586-php7-xhprof - PHP hierarchical profiler
i586-php7-xmlreader - PHP module for support XML
i586-php7-xmlrpc - PHP module to write XML-RPC servers and clients
i586-php7-xsl - Sablotron XSLT support for PHP
i586-php7-yaml - PHP5 YAML-1.1 parser and emitter
i586-php7-zip - ZIP functions
i586-php8.0-apcu - PHP extension APCu - APC User Cache
i586-php8.0-bz2 - A Bzip2 management extension
i586-php8.0-calendar - Date conversion between different calendar formats
i586-php8.0-curl - CURL extension for PHP
i586-php8.0-dba - DBA (gdbm, db4) module for PHP
i586-php8.0-exif - Read header information from JPEG and DIFF headers
i586-php8.0-fileinfo - Fileinfo PHP extension try to guess the content type and encoding of a file
i586-php8.0-gd - GD library support for PHP
i586-php8.0-gmagick - php extension to work with images using the GraphicsMagick API
i586-php8.0-gmp - GNU MP support for PHP
i586-php8.0-igbinary - Replacement for the standard PHP serializer
i586-php8.0-imagick - PHP wrapper to the ImageMagick library
i586-php8.0-imap - IMAP module for PHP
i586-php8.0-intl - Internationalization extension is a wrapper for ICU library
i586-php8.0-ldap - LDAP module for PHP
i586-php8.0-libs - Package with common data for various PHP packages
i586-php8.0-mbstring - PHP module for support multi-byte strings.
i586-php8.0-mcrypt - Mcrypt library support for PHP
i586-php8.0-memcache - memcached extension for php8.0
i586-php8.0-memcached - php extension for interfacing with memcached via libmemcached library
i586-php8.0-mysqlnd - Native PHP driver for MySQL
i586-php8.0-mysqlnd-mysqli - MySQL Improved Extension for PHP with Native Driver
i586-php8.0-opcache - Zend Opcache extension for opcode caching and optimization
i586-php8.0-openssl - OpenSSL module for php
i586-php8.0-pcntl - Process Control Module for PHP (pcntl)
i586-php8.0-pdo - PHP Data Objects Interface
i586-php8.0-pdo_mysql - MySQL driver for PHP Data Objects Interface
i586-php8.0-pdo_odbc - ODBC driver for PHP Data Objects Interface
i586-php8.0-pdo_pgsql - PostgreSQL driver for PHP Data Objects Interface
i586-php8.0-pdo_sqlite - SQLLite v3 driver for PHP Data Objects Interface
i586-php8.0-pgsql - PostgreSQL database module for PHP
i586-php8.0-readline - Readline functions
i586-php8.0-redis - Client extension for Redis key-value store
i586-php8.0-smbclient - A PHP wrapper for libsmbclient
i586-php8.0-snmp - SNMP module for PHP
i586-php8.0-soap - Provides SOAP Services for PHP
i586-php8.0-sockets - Sockets support for PHP
i586-php8.0-sodium - Sodium library support for PHP
i586-php8.0-sphinx - PHP bindings for Sphinx search client library
i586-php8.0-ssh2 - PHP bindings for the libssh2 library
i586-php8.0-swoole - Coroutine-based concurrency library for PHP
i586-php8.0-tidy - PHP binding for the Tidy HTML clean and repair utility
i586-php8.0-xdebug - xdebug extensions
i586-php8.0-xhprof - PHP hierarchical profiler
i586-php8.0-xmlreader - PHP module for support XML
i586-php8.0-xmlrpc - PHP module to write XML-RPC servers and clients
i586-php8.0-xsl - Sablotron XSLT support for PHP
i586-php8.0-yaml - PHP5 YAML-1.1 parser and emitter
i586-php8.0-zip - ZIP functions
i586-php8.1-amqp - PHP extension to communicate with any AMQP compliant server
i586-php8.1-apcu - PHP extension APCu - APC User Cache
i586-php8.1-ast - Extension exposing PHP 7 abstract syntax tree
i586-php8.1-bz2 - A Bzip2 management extension
i586-php8.1-calendar - Date conversion between different calendar formats
i586-php8.1-curl - CURL extension for PHP
i586-php8.1-dba - DBA (gdbm, db4) module for PHP
i586-php8.1-exif - Read header information from JPEG and DIFF headers
i586-php8.1-fileinfo - Fileinfo PHP extension try to guess the content type and encoding of a file
i586-php8.1-gd - GD library support for PHP
i586-php8.1-gmagick - php extension to work with images using the GraphicsMagick API
i586-php8.1-gmp - GNU MP support for PHP
i586-php8.1-igbinary - Replacement for the standard PHP serializer
i586-php8.1-imagick - PHP wrapper to the ImageMagick library
i586-php8.1-imap - IMAP module for PHP
i586-php8.1-intl - Internationalization extension is a wrapper for ICU library
i586-php8.1-ldap - LDAP module for PHP
i586-php8.1-libs - Package with common data for various PHP packages
i586-php8.1-mbstring - PHP module for support multi-byte strings.
i586-php8.1-mcrypt - Mcrypt library support for PHP
i586-php8.1-memcache - memcached extension for php8.1
i586-php8.1-memcached - php extension for interfacing with memcached via libmemcached library
i586-php8.1-mysqlnd - Native PHP driver for MySQL
i586-php8.1-mysqlnd-mysqli - MySQL Improved Extension for PHP with Native Driver
i586-php8.1-opcache - Zend Opcache extension for opcode caching and optimization
i586-php8.1-openssl - OpenSSL module for php
i586-php8.1-pcntl - Process Control Module for PHP (pcntl)
i586-php8.1-pdo - PHP Data Objects Interface
i586-php8.1-pdo_mysql - MySQL driver for PHP Data Objects Interface
i586-php8.1-pdo_odbc - ODBC driver for PHP Data Objects Interface
i586-php8.1-pdo_pgsql - PostgreSQL driver for PHP Data Objects Interface
i586-php8.1-pdo_sqlite - SQLLite v3 driver for PHP Data Objects Interface
i586-php8.1-pgsql - PostgreSQL database module for PHP
i586-php8.1-readline - Readline functions
i586-php8.1-redis - Client extension for Redis key-value store
i586-php8.1-smbclient - A PHP wrapper for libsmbclient
i586-php8.1-snmp - SNMP module for PHP
i586-php8.1-soap - Provides SOAP Services for PHP
i586-php8.1-sockets - Sockets support for PHP
i586-php8.1-sodium - Sodium library support for PHP
i586-php8.1-sphinx - PHP bindings for Sphinx search client library
i586-php8.1-ssh2 - PHP bindings for the libssh2 library
i586-php8.1-tidy - PHP binding for the Tidy HTML clean and repair utility
i586-php8.1-xdebug - xdebug extensions
i586-php8.1-xhprof - PHP hierarchical profiler
i586-php8.1-xmlreader - PHP module for support XML
i586-php8.1-xmlrpc - PHP module to write XML-RPC servers and clients
i586-php8.1-xsl - Sablotron XSLT support for PHP
i586-php8.1-yaml - PHP5 YAML-1.1 parser and emitter
i586-php8.1-zip - ZIP functions
i586-php8.2-amqp - PHP extension to communicate with any AMQP compliant server
i586-php8.2-apcu - PHP extension APCu - APC User Cache
i586-php8.2-ast - Extension exposing PHP 7 abstract syntax tree
i586-php8.2-bz2 - A Bzip2 management extension
i586-php8.2-calendar - Date conversion between different calendar formats
i586-php8.2-curl - CURL extension for PHP
i586-php8.2-dba - DBA (gdbm, db4) module for PHP
i586-php8.2-exif - Read header information from JPEG and DIFF headers
i586-php8.2-fileinfo - Fileinfo PHP extension try to guess the content type and encoding of a file
i586-php8.2-gd - GD library support for PHP
i586-php8.2-gmagick - php extension to work with images using the GraphicsMagick API
i586-php8.2-gmp - GNU MP support for PHP
i586-php8.2-igbinary - Replacement for the standard PHP serializer
i586-php8.2-imagick - PHP wrapper to the ImageMagick library
i586-php8.2-imap - IMAP module for PHP
i586-php8.2-intl - Internationalization extension is a wrapper for ICU library
i586-php8.2-ldap - LDAP module for PHP
i586-php8.2-libs - Package with common data for various PHP packages
i586-php8.2-mbstring - PHP module for support multi-byte strings.
i586-php8.2-mcrypt - Mcrypt library support for PHP
i586-php8.2-memcache - memcached extension for php8.2
i586-php8.2-memcached - php extension for interfacing with memcached via libmemcached library
i586-php8.2-mysqlnd - Native PHP driver for MySQL
i586-php8.2-mysqlnd-mysqli - MySQL Improved Extension for PHP with Native Driver
i586-php8.2-opcache - Zend Opcache extension for opcode caching and optimization
i586-php8.2-openssl - OpenSSL module for php
i586-php8.2-pcntl - Process Control Module for PHP (pcntl)
i586-php8.2-pdo - PHP Data Objects Interface
i586-php8.2-pdo_mysql - MySQL driver for PHP Data Objects Interface
i586-php8.2-pdo_odbc - ODBC driver for PHP Data Objects Interface
i586-php8.2-pdo_pgsql - PostgreSQL driver for PHP Data Objects Interface
i586-php8.2-pdo_sqlite - SQLLite v3 driver for PHP Data Objects Interface
i586-php8.2-pgsql - PostgreSQL database module for PHP
i586-php8.2-readline - Readline functions
i586-php8.2-redis - Client extension for Redis key-value store
i586-php8.2-smbclient - A PHP wrapper for libsmbclient
i586-php8.2-snmp - SNMP module for PHP
i586-php8.2-soap - Provides SOAP Services for PHP
i586-php8.2-sockets - Sockets support for PHP
i586-php8.2-sodium - Sodium library support for PHP
i586-php8.2-sphinx - PHP bindings for Sphinx search client library
i586-php8.2-ssh2 - PHP bindings for the libssh2 library
i586-php8.2-tidy - PHP binding for the Tidy HTML clean and repair utility
i586-php8.2-xdebug - xdebug extensions
i586-php8.2-xhprof - PHP hierarchical profiler
i586-php8.2-xmlreader - PHP module for support XML
i586-php8.2-xmlrpc - PHP module to write XML-RPC servers and clients
i586-php8.2-xsl - Sablotron XSLT support for PHP
i586-php8.2-yaml - PHP5 YAML-1.1 parser and emitter
i586-php8.2-zip - ZIP functions
i586-unit-php - PHP module for NGINX Unit
LogAnalyzer-php7 - php7 virtual package for LogAnalyzer
alterator-php-functions - Helps the base PHP configuration management
fckeditor-php - Integration fckeditor with PHP
glpi-php8.1 - PHP8.1 dependencies for glpi
glpi-php8.2 - PHP8.2 dependencies for glpi
icinga-php-library - Icinga PHP Library for Icinga Web 2
icinga-php-thirdparty - Icinga PHP Thirdparty for Icinga Web 2
icingaweb2-php - Icinga Web PHP library
icingaweb2-php-fpm - PHP-FPM configuration for icingaweb2
icingaweb2-php-mysql - MySQL PDO bindings for Icinga Web PHP library
icingaweb2-php-pgsql - PostgreSQL PDO bindings for Icinga Web PHP library
itop-php8.1 - PHP8.1 dependencies for itop
mediawiki - A wiki engine, typical installation (php8.2 with Apache2 and MySQL support)
mediawiki-php7 - Mediawiki's requires for php 7.4
mediawiki-php8.0 - Mediawiki's requires for php 8.0
mediawiki-php8.1 - Mediawiki's requires for php 8.1
mediawiki-php8.2 - Mediawiki's requires for php 8.2
pear-Gtk_VarDump - A simple GUI to example php data trees
pear-PhpDocumentor - The phpDocumentor package provides automatic documenting of php api directly from the source.
rpm-build-php7-version - RPM helper macros to rebuild PHP7 packages
php7-jpgraph - 2D graph plotting library for PHP
rpm-build-php8.0-version - RPM helper macros to rebuild packages for PHP 8.0
php8.0-jpgraph - 2D graph plotting library for PHP
rpm-build-php8.1-version - RPM helper macros to rebuild PHP7 packages
php-jpgraph - JpGraph documentation
php-jpgraph-doc - JpGraph documentation
php8.1-jpgraph - 2D graph plotting library for PHP
rpm-build-php8.2-version - RPM helper macros to rebuild packages for PHP 8.2
php8.2-jpgraph - 2D graph plotting library for PHP
phpMyAdmin - phpMyAdmin - web-based MySQL administration
phpMyAdmin-apache2-php8.0 - phpMyAdmin - web-based MySQL administration (for apache 2.4 and php8.0)
phpMyAdmin-apache2-php8.1 - phpMyAdmin - web-based MySQL administration (for apache 2.4 and php8.1)
phpMyAdmin-apache2-php8.2 - phpMyAdmin - web-based MySQL administration (for apache 2.4 and php8.2)
phpipam - PHP-based virtual machine control tool
phpipam-apache2 - apache2 configs for phpipam
phpldapadmin - Управление LDAP сервером через web
phply - Lexer and parser for PHP source implemented using PLY
python3-module-phply - Lexer and parser for PHP source implemented using PLY
rpm-build-php - RPM helper macros to rebuild PHP packages
zabbix-phpfrontend-apache2 - zabbix-phpfrontend's apache2 config files
zabbix-phpfrontend-apache2-mod_php8.0 - Requirements for the use of apache2-mod_php8.0
zabbix-phpfrontend-apache2-mod_php8.1 - Requirements for the use of apache2-mod_php8.1
zabbix-phpfrontend-apache2-mod_php8.2 - Requirements for the use of apache2-mod_php8.2
zabbix-phpfrontend-engine - zabbix web frontend (php)
zabbix-phpfrontend-nginx - zabbix-phpfrontend's nginx config files
zabbix-phpfrontend-nginx-php8.0-fpm-fcgi - Requirements for the use of php8.0-fpm-fcgi
zabbix-phpfrontend-nginx-php8.1-fpm-fcgi - Requirements for the use of php8.1-fpm-fcgi
zabbix-phpfrontend-nginx-php8.2-fpm-fcgi - Requirements for the use of php8.2-fpm-fcgi
zabbix-phpfrontend-php8.0 - zabbix web frontend, edition for php8.0
zabbix-phpfrontend-php8.1 - zabbix web frontend, edition for php8.1
zabbix-phpfrontend-php8.2 - zabbix web frontend, edition for php8.2
После установки, проверьте, установлены ли необходимые расширения:
php8.2 -m | grep -i pdo
или, если используется версия 8.1:
php8.1 -m | grep -i pdo
Альтернативные методы установки
Если вышеуказанные методы не сработают, рассмотрите возможность установки PHP через remi репозиторий или используя Docker, если хотите получать доступ к последним версиям с минимальными усилиями.
В зависимости от вашего дистрибутива и используемого менеджера пакетов, доступные вам версии и пакеты могут варьироваться. Если у вас остались вопросы или возникают проблемы, не стесняйтесь спрашивать!