This article mainly introduces how to install phpmcrypt extension using yum in CentOS. For more information, see CentOS.
When you use yum install php-mcrypt to install the mcrypt extension, the system prompts that the installation package is not installed.
Setting up Install Process
No package php-mcrypt available.
Error: Nothing to do
Mcrypt is an encrypted Extension Library, which can be used to load it.22 encryption and decryption algorithms
CentOS6 is installed with php5.3.2 by default.
The default redhat repos php does not contain mcrypt extensions.
According to Red Hat Official News (https://bugzilla.redhat.com/show_bug.cgi? Id = 621268) RHEL does not intend to add mcrypt support for PHP
Joe Orton 2010-08-05 04:47:17 EDT
Thanks for the report.
We are not planning to ship mcrypt support for PHP.
Solution:
Download the new php 5.3 source code package from the php official website and decompress it to the local directory.
After entering the ext directory under the extracted Directory, mcrypt will be found,
Go to the mcrypt Directory
# Cd/ext/mcrypt
# Phpize
Note: If-bash: phpize not Found is reported, yum install php-devel can enable phpize to dynamically compile and install extensions.
#./Configure-with-php-config =/usr/sbin/php/bin/php-config
# Make & make install
Appears:
----------------------------------------------------------------------
Libraries have been installed in:
/Var/php-5.3.10/ext/mcrypt/modules
If you ever happen to want to link against installed libraries
In a given directory, LIBDIR, you must either use libtool, and
Specify the full pathname of the library, or use the '-llibdir'
Flag during linking and do at least one of the following:
-Add LIBDIR to the 'ld _ LIBRARY_PATH 'environment variable
During execution
-Add LIBDIR to the 'ld _ RUN_PATH 'environment variable
During linking
-Use the '-Wl,-rpath-Wl, libdir' linker flag
-Have your system administrator add LIBDIR to '/etc/ld. so. Conf'
See any operating system documentation about shared libraries
More information, such as the ld (1) and ld. so (8) manual pages.
----------------------------------------------------------------------
Build complete.
Don't forget to run 'Make test '.
Installing shared extensions:/usr/lib64/php/modules/
View:
# Php-m
...
Libxml
Mbstring
Mcrypt
Mysql
...
[Zend Modules]
Installed successfully!
View phpinfo again to view the mcrypt extension details.