Package php mcrypt has no installation candidate

Shell package php mcrypt has no installation candidate

When successful, checking for the presence of the mcrypt PHP module should produce the following output: Solution 1: Ubuntu 16.04 comes with PHP7 as the standard, so there are no PHP5 packages However if you like you can add a PPA to get those packages anyways: Remove all the stock php packages List installed php packages with then remove unneeded packages with sudo aptitude purge your_packages_here Solution 2: You must use prefix «php5.6-» instead of «php5-» as in ubuntu 14.04 and olders: Solution 3: If you just want to install PHP no matter what version it is, try PHP7 Solution: remove old epel repo remove all package of php search php package by yum list installed | grep phpyum remove pacakge name download new epel http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm rpm -Uvh epel-release* then install php Install php-mcrypt install gd extension php ubuntu Install or enable PHP’s gd extension

Php-mcrypt package missing in Ubuntu Server 18.04 LTS

Mcrypt has been deprecated in PHP 7.2, so it’s not available by default.

Читайте также:  Python join int to str

You can still install the mcrypt extension using pecl. These instructions are for the apache web server.

# Install prerequisites sudo apt-get install php-dev libmcrypt-dev gcc make autoconf libc-dev pkg-config # Compile mcrypt extension sudo pecl install mcrypt-1.0.1 # Just press enter when it asks about libmcrypt prefix # Enable extension for apache echo "extension=mcrypt.so" | sudo tee -a /etc/php/7.2/apache2/conf.d/mcrypt.ini # Restart apache sudo service apache2 restart 

That should get you going.

In the long term you might want to replace mcrypt , it’s deprecated for a reason.

I did the following to get this working.

sudo add-apt-repository ppa:ondrej/php sudo apt-get install php7.1-mcrypt 

If you’re running php5.6 or 7.0 then you can use the following

sudo apt-get install php5.6-mcrypt sudo apt-get install php7.0-mcrypt 

First Check whether the mcrypt PHP module is present:

To install the mcrypt PHP module we first need to satisfy the following prerequisites:

sudo apt install php-dev libmcrypt-dev php-pear 

Now we are ready to install mcrypt PHP module on our Ubuntu 18.04 system:

$ sudo pecl channel-update pecl.php.net $ sudo pecl install mcrypt-1.0.1 

Open the /etc/php/7.2/cli/php.ini file and insert:

All done. When successful, checking for the presence of the mcrypt PHP module should produce the following output:

$ php -m | grep mcrypt mcrypt 

E package ‘python-pip’ has no installation candidate, # Just update and upgrade sudo apt update && sudo apt upgrade -y

Package php5 have no installation candidate (Ubuntu 16.04)

Ubuntu 16.04 comes with PHP7 as the standard, so there are no PHP5 packages

However if you like you can add a PPA to get those packages anyways:

Remove all the stock php packages

List installed php packages with dpkg -l | grep php| awk » |tr «\n» » » then remove unneeded packages with sudo aptitude purge your_packages_here or if you want to directly remove them all use :

sudo aptitude purge `dpkg -l | grep php| awk '' |tr "\n" " "` 

Add the PPA

sudo add-apt-repository ppa:ondrej/php 

Install your PHP Version

sudo apt-get update sudo apt-get install php5.6 

You can install php5.6 modules too ..

Verify your version

Based on https://askubuntu.com/a/756186/532957 (thanks @AhmedJerbi)

You must use prefix «php5.6-» instead of «php5-» as in ubuntu 14.04 and olders:

sudo apt-get install php5.6 php5.6-mcrypt 

If you just want to install PHP no matter what version it is, try PHP7

sudo apt-get install php7.0 php7.0-mcrypt 

Php-mcrypt package missing in Ubuntu Server 18.04 LTS, apt install php-mcrypt Reading package lists Done Building dependency tree Reading state information Done Package php-mcrypt 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: …

PHP mcrypt error in Centos 7

  1. remove old epel repo
  2. remove all package of php
  3. search php package by yum list installed | grep php
  4. yum remove pacakge name
  5. download new epel http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm
  6. rpm -Uvh epel-release*
  7. then install php
  8. Install php-mcrypt

Raspberry Package ‘php5-mysql’ has no installation, Shell/Bash answers related to “raspberry Package ‘php5-mysql’ has no installation candidate”. raspi pip command not found. install raspap. install samba on raspberry pi. problem with dependency and installation mariadb-server in ubuntu server 18.04LTS. Package ‘php7.4-curl’ has no installation candidate.

Package ‘php-gd’ has no installation candidate

install gd extension php ubuntu

#install gd extension, 7.4 replace it with your version sudo apt-get install php7.4-gd #check if installed php -m | grep gd #restart your web server sudo service apache2 restart or sudo service nginx restart

Install or enable PHP’s gd extension

Источник

🔐 Установка расширения PHP mcrypt на Ubuntu 20.04 | 18,04

Мануал

Как исправить ошибку «E: Package ‘php-mcrypt’ has no installation candidate» на Ubuntu 20.04 / 18.04 ?

Расширение PHP mcrypt является интерфейсом библиотеки криптографии mcrypt и поддерживает широкий спектр алгоритмов, таких как DES, TripleDES, Blowfish (по умолчанию), 3-WAY, SAFER-SK64, SAFER-SK128, TWOFISH, TEA, RC2 и ГОСТ в режимах шифрования CBC, OFB, CFB и ECB.

$ sudo apt install php-mcrypt Reading package lists. Done Building dependency tree Reading state information. Done Package php-mcrypt 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 'php-mcrypt' has no installation candidate

PECL – это репозиторий для всех известных расширений PHP, откуда пользователи могут загружать и размещать разработанные расширения PHP.

Укажите вашей ОС вытащить последний список пакетов, доступных в репозиториях:

Установите средства разработки на Ubuntu:

sudo apt update sudo apt install -y build-essential
$ gcc --version gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0 Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ make --version GNU Make 4.2.1 Built for x86_64-pc-linux-gnu Copyright (C) 1988-2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Сначала вам нужно установить расширения PHP, dev и pear в Ubuntu 20.04 | 18.04.

sudo apt install php php-pear php-dev libmcrypt-dev

Убедитесь, что команда pecl доступна в вашей системе.

$ pecl help Commands: build Build an Extension From C Source bundle Unpacks a Pecl Package channel-add Add a Channel channel-alias Specify an alias to a channel name channel-delete Remove a Channel From the List channel-discover Initialize a Channel from its server channel-info Retrieve Information on a Channel channel-login Connects and authenticates to remote channel server channel-logout Logs out from the remote channel server channel-update Update an Existing Channel clear-cache Clear Web Services Cache config-create Create a Default configuration file config-get Show One Setting config-help Show Information About Setting config-set Change Setting config-show Show All Settings convert Convert a package.xml 1.0 to package.xml 2.0 format cvsdiff Run a "cvs diff" for all files in a package cvstag Set CVS Release Tag download Download Package download-all Downloads each available package from the default channel info Display information about a package install Install Package list List Installed Packages In The Default Channel list-all List All Packages list-channels List Available Channels list-files List Files In Installed Package list-upgrades List Available Upgrades login Connects and authenticates to remote server [Deprecated in favor of channel-login] logout Logs out from the remote server [Deprecated in favor of channel-logout] makerpm Builds an RPM spec file from a PEAR package package Build Package package-dependencies Show package dependencies package-validate Validate Package Consistency pickle Build PECL Package remote-info Information About Remote Packages remote-list List Remote Packages run-scripts Run Post-Install Scripts bundled with a package run-tests Run Regression Tests search Search remote package database shell-test Shell Script Test sign Sign a package distribution file svntag Set SVN Release Tag uninstall Un-install Package update-channels Update the Channel List upgrade Upgrade Package upgrade-all Upgrade All Packages [Deprecated in favor of calling upgrade with no parameters] Usage: pecl [options] command [command-options] Type "pecl help options" to list all options. Type "pecl help shortcuts" to list all command shortcuts. Type "pecl help version" or "pecl version" to list version information. Type "pecl help " to get the help for the specified command.
$ sudo pecl channel-update pecl.php.net Updating channel "pecl.php.net" Update of Channel "pecl.php.net" succeeded $ sudo pecl update-channels Updating channel "doc.php.net" Update of Channel "doc.php.net" succeeded Updating channel "pear.php.net" Update of Channel "pear.php.net" succeeded Updating channel "pecl.php.net" Channel "pecl.php.net" is up to date

Давайте поищем расширение mcrypt.

$ sudo pecl search mcrypt Matched packages, channel pecl.php.net: ======================================= Package Stable/(Latest) Local mcrypt 1.0.3 (stable) Bindings for the libmcrypt library mcrypt_filter 0.1.0 (beta) Applies mcrypt symmetric encryption using stream filters
$ sudo pecl install mcrypt downloading mcrypt-1.0.3.tgz . Starting to download mcrypt-1.0.3.tgz (33,590 bytes) . done: 33,590 bytes 6 source files, building running: phpize Configuring for: PHP Api Version: 20190902 Zend Module Api No: 20190902 Zend Extension Api No: 320190902 .

Когда вы видите подсказку

libmcrypt prefix? [autodetect] :

Нажмите Enter для автоопределения.

Вы должны получить вывод, аналогично показанному ниже по завершению установки расширения mcrypt на компьютере с Linux Ubuntu 20.04.

Build process completed successfully Installing '/usr/lib/php/20190902/mcrypt.so' install ok: channel://pecl.php.net/mcrypt-1.0.3 configuration option "php_ini" is not set to php.ini location You should add "extension=mcrypt.so" to php.ini

Включите расширение в файле php.ini. Ubuntu 20.04:

$ sudo vim /etc/php/7.4/cli/php.ini extension=mcrypt.so $ sudo vim /etc/php/7.4/apache2/php.ini extension=mcrypt.so 

Ubuntu 18.04:

$ sudo vim /etc/php/7.2/cli/php.ini extension=mcrypt.so $ sudo vim /etc/php/7.2/apache2/php.ini extension=mcrypt.so 
$ php -m | grep mcrypt mcrypt

Если вы используете приложение, размещенное на веб-сервере Apache или Nginx, перезапустите их.

--- рестарт Apache --- $ sudo systemctl restart apache2 --- рестарт nginx --- $ sudo systemctl restart nginx

Источник

Как установить PHP-модуль mcrypt на Ubuntu 18.04 Linux

Цель состоит в том, чтобы установить модуль mcrypt PHP на Ubuntu 18.04 Linux.

Версии операционной системы и программного обеспечения

  • Операционная система: — Ubuntu 18.04 Linux
  • Программное обеспечение: — PHP 7.2 или выше.

Требования

Требуется привилегированный доступ к вашей системе Ubuntu с правами root или с помощью команды sudo .

Сложность

Соглашения

инструкции

установка PHP

Скорее всего, у вас уже установлен PHP, но любая попытка установить PHP-модуль mcrypt завершается с ошибкой:

E: Package 'php-mcrypt' has no installation candidate

Если это так, просто пропустите этот шаг. В качестве альтернативы выполните базовую установку PHP:

Затем проверьте наличие PHP-модуля mcrypt :

Установка предварительных условий

Чтобы установить PHP-модуль mcrypt , сначала необходимо выполнить следующие предварительные условия:

$ sudo apt install php-dev libmcrypt-dev php-pear

Установите PHP-модуль mcrypt

Теперь мы готовы установить PHP-модуль mcrypt в нашу систему Ubuntu 18.04:

$ sudo pecl channel-update pecl.php.net $ sudo pecl install mcrypt-1.0.1 . Build process completed successfully Installing '/usr/lib/php/20170718/mcrypt.so' install ok: channel://pecl.php.net/mcrypt-1.0.1 configuration option "php_ini" is not set to php.ini location You should add "extension=mcrypt.so" to php.ini

Наконец, как следует из результатов компиляции, нам нужно включить PHP-модуль mcrypt в соответствующем файле php.ini . Ваша конфигурация может отличаться, нижеприведенное служит только решением для конфигурации PHP CLI по умолчанию. Откройте файл /etc/php/7.2/cli/php.ini и вставьте:

Обратите внимание, что если вы используете веб-сервер Apache или Nginx или другую версию PHP, расположение загруженного файла php.ini может отличаться.

Все сделано. В случае успеха проверка наличия PHP-модуля mcrypt должна привести к следующему выводу:

$ php -m | grep mcrypt mcrypt

Источник

Оцените статью