centos source code compilation php5 mcrypt module steps
- 2020-05-07 20:45:10
- OfStack
Steps:
1. Download the source code of php5.3.x version from php.net.
2.centos installation:
yum install libmcrypt libmcrypt-devel mcrypt mhash
The following development environment is intended to compile the entire php source preparation environment, and this compilation of the mcrypt extension does not require execution.
yum install -y httpd-devel libtool-ltdl libtool-ltdl-devel openssl-devel curl-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. Confirm that phpize has been installed to the server:
whereis phpize
Determine the location of 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 (not in a function)
Solutions:
sed -i 's|PHP_FE_END|{NULL,NULL,NULL}|' ./ext/**/*.c
make
If it is an ZEND_MOD_END error, execute:
sed -i 's|ZEND_MOD_END|{NULL,NULL,NULL}|' ./ext/**/*.c
5. Execute make test, there is no problem in the test.
make install
6. Add files: / etc/php d/mcrypt ini
; Enable mbstring extension module
extension=mcrypt.so
7. Restart web server and check whether php mcrypt has been installed successfully.