Steps:
1. Download the php5.3.x version of the source code from the php.net;
2.centos install the appropriate expansion pack:
Copy Code code as follows:
Yum install Libmcrypt libmcrypt-devel mcrypt Mhash
The following development environment is to compile the entire PHP source preparation environment, this compilation MCrypt extension does not need to execute.
Copy Code code as follows:
Yum install-y httpd-devel Libtool-ltdl libtool-ltdl-devel openssl-devel \
Libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel \
Libc-client libc-client-devel gd gd-devel libmcrypt libmcrypt-devel \
SQLite sqlite-devel mysql-devel Libicu libicu-devel pcre-devel
3. Determine if Phpize is installed to the server:
Whereis phpize
Determine the location of the Php-config:
Whereis Php-config
Perform:
./configure–with-php-config=/usr/bin/php-config
4.make Error:
Mcrypt.c:283:error: ' Php_fe_end ' undeclared here (no in a function)
Workaround:
Copy Code code as follows:
Sed-i ' s| php_fe_end| {null,null,null}| ' ./ext/**/*.c
Make
If it is a zend_mod_end error, execute:
Copy Code code as follows:
Sed-i ' s| zend_mod_end| {null,null,null}| ' ./ext/**/*.c
5. Perform the next make test and the tests are fine. Re-execution:
Copy Code code as follows:
6. Additional Documents:/etc/php.d/mcrypt.ini
Copy Code code as follows:
; Enable mbstring Extension Module
Extension=mcrypt.so
7. Restart the Web server to check that the PHP MCrypt is installed successfully.