Làm thế nào tôi có thể giải quyết “E. Gói ‘php-mcrypt’ không có ứng cử viên cài đặt” trên Ubuntu 20. 18/04. 04?. Hướng dẫn hôm nay sẽ về cài đặt tiện ích mở rộng PHP mcrypt trên Ubuntu 20. 18/04. 04. Phần mở rộng mcrypt PHP là một giao diện cho thư viện mật mã mcrypt và nó hỗ trợ nhiều thuật toán khối như DES, TripleDES, Blowfish [mặc định], 3-WAY, SAFER-SK64, SAFER-SK128, TWOFISH, TEA, RC2 và
Cách cài đặt PHP 8 trên Ubuntu 20. 0
Vui lòng bật JavaScript
Nếu bạn thử cài đặt mcrypt với apt, bạn sẽ gặp lỗi
$ sudo apt update
$ 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
Tiện ích mở rộng mcrypt đã được chuyển đến kho lưu trữ PECL và không còn đi kèm với PHP kể từ PHP 7. 2. 0. PECL là kho lưu trữ cho tất cả các tiện ích mở rộng PHP đã biết, nơi người dùng có thể tải xuống và lưu trữ các tiện ích mở rộng PHP đã phát triển
Yêu cầu hệ điều hành của bạn lấy danh sách các gói mới nhất có sẵn trong kho để cài đặt
sudo apt update
Cài đặt các công cụ phát triển trên Ubuntu
sudo apt install -y build-essential
Xác nhận make và gcc
$ gcc --version
gcc [Ubuntu 9.4.0-1ubuntu1~20.04.1] 9.4.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.
Trước tiên, bạn cần cài đặt các tiện ích mở rộng PHP, dev và lê trên Ubuntu 20. 04. 18. 04
sudo apt install php php-pear php-dev libmcrypt-dev
Xác nhận lệnh pecl có sẵn trong hệ thống của bạn
$ which pecl
/usr/bin/pecl
sử dụng 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.
Cập nhật kênh
$ 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
Hãy tìm kiếm tiện ích mở rộng mcrypt
________số 8_______Bạn có thể cài đặt tiện ích mở rộng mcrypt bằng lệnh pecl với tùy chọn cài đặt
$ sudo pecl install mcrypt
downloading mcrypt-1.0.4.tgz ...
Starting to download mcrypt-1.0.4.tgz [27,056 bytes]
.........done: 27,056 bytes
6 source files, building
running: phpize
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
........
Khi bạn nhìn thấy lời nhắc
sudo apt update
0Nhấn Enter để tự động phát hiện
Bạn sẽ nhận được một đầu ra như bên dưới để cài đặt hoàn tất tiện ích mở rộng mcrypt trên Ubuntu 20. 04 máy Linux
sudo apt update
1Kích hoạt tiện ích mở rộng trong php. tập tin ini. Bạn có thể sử dụng trình soạn thảo
sudo apt update
5 hoặc sudo apt update
6sudo apt update
2Bạn có thể xác nhận rằng mô-đun đã được cài đặt và kích hoạt bằng lệnh
sudo apt update
3Nếu sử dụng một ứng dụng được lưu trữ trên máy chủ web Apache hoặc Nginx, hãy khởi động lại chúng
sudo apt update
4Và đó là cách bạn có thể dễ dàng cài đặt tiện ích mở rộng mcrypt PHP trên Ubuntu 20. 4 & Ubuntu 18. 04 Hệ thống Linux
Video khóa học lập trình web PHP
- Khóa học dành cho nhà phát triển web hoàn chỉnh
- PHP cho người mới bắt đầu – Trở thành chuyên gia PHP – Dự án CMS
- Chương trình đào tạo dành cho nhà phát triển web PHP Full Stack hoàn chỉnh
- PHP với Laravel cho người mới bắt đầu – Trở thành Master trong Laravel
- PHP OOP. Lập trình hướng đối tượng cho người mới bắt đầu + Dự án
BẠN CÓ THỂ HỖ TRỢ CÔNG VIỆC CỦA CHÚNG TÔI BẰNG LY CÀ PHÊ
Khi chúng tôi tiếp tục phát triển, chúng tôi mong muốn tiếp cận và tác động đến nhiều người hơn, những người truy cập và tận dụng các hướng dẫn chúng tôi có trên blog của mình. Đây là một nhiệm vụ lớn đối với chúng tôi và cho đến nay chúng tôi vô cùng biết ơn những người tốt bụng đã thể hiện sự hỗ trợ tuyệt vời cho công việc của chúng tôi trong suốt thời gian chúng tôi trực tuyến
Cảm ơn sự hỗ trợ của bạn khi chúng tôi làm việc để cung cấp cho bạn những hướng dẫn và bài viết tốt nhất. Nhấp vào bên dưới để mua cà phê cho chúng tôi