mcrypt installieren

Haben Sie einen Bug entdeckt? Teilen Sie es uns mit.
Post Reply
olek2003
Posts: 26
Joined: Thu 18. Jul 2019, 20:27

mcrypt installieren

Post by olek2003 »

Guten Tag,

wie kann ich im KeyHelp System das PHP Modul mcrypt nachinstallieren?

Mfg
Olek
User avatar
Florian
Keyweb AG
Posts: 1258
Joined: Wed 20. Jan 2016, 02:28

Re: mcrypt installieren

Post by Florian »

Hallo,

für die System PHP Version, Beispiel Debian 11:

Code: Select all

apt install php-dev libmcrypt-dev
pecl install mcrypt
echo "extension=mcrypt.so" > /etc/php/7.4/mods-available/mcrypt.ini
phpenmod mcrypt
systemctl restart php7.4-fpm.service
Mit freundlichen Grüßen / Best regards
Florian Cheno

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
olek2003
Posts: 26
Joined: Thu 18. Jul 2019, 20:27

Re: mcrypt installieren

Post by olek2003 »

Vielen Dank, das hat mich schon weitergebracht.
Jetzt habe ich leider nur das Problem, dass es mir in der php.info nicht angezeigt wird,
wie es sollte.

Muss ich für die PHP Versionen unter KeyHelp eine andere Exentsion laden?

Danke.

MfG
Olek
User avatar
Florian
Keyweb AG
Posts: 1258
Joined: Wed 20. Jan 2016, 02:28

Re: mcrypt installieren

Post by Florian »

Hallo,

ja das Beispiel war für die Standard PHP Version. Wenn man eine Keyhelp PHP Version nutzt muss man es dafür separat kompilieren.

Ich habe das hier am Beispiel für Redis mal erklärt:

viewtopic.php?p=40585#p40585

Der Weg für Mcrypt ist derselbe, man muss nur die PHP Version und den Downlaod des PECL Paketes anpassen
Mit freundlichen Grüßen / Best regards
Florian Cheno

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
olek2003
Posts: 26
Joined: Thu 18. Jul 2019, 20:27

Re: mcrypt installieren

Post by olek2003 »

Habe ich gemacht, die info.php bleibt aber nach wie vor leer.

root@server4012:~# wget https://pecl.php.net/get/mcrypt-1.0.6.tgz
--2023-05-24 19:00:24-- https://pecl.php.net/get/mcrypt-1.0.6.tgz
Auflösen des Hostnamens pecl.php.net (pecl.php.net)… 104.236.228.160
Verbindungsaufbau zu pecl.php.net (pecl.php.net)|104.236.228.160|:443 … verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 200 OK
Länge: 27062 (26K) [application/octet-stream]
Wird in »mcrypt-1.0.6.tgz« gespeichert.

mcrypt-1.0.6.tgz 100%[====================================================================>] 26,43K --.-KB/s in 0,08s

2023-05-24 19:00:24 (322 KB/s) - »mcrypt-1.0.6.tgz« gespeichert [27062/27062]

root@server4012:~# tar xzf mcrypt-1.0.6.tgz
root@server4012:~# cd mcrypt-1.0.6.tgz
-bash: cd: mcrypt-1.0.6.tgz: Ist kein Verzeichnis
root@server4012:~# cd mcrypt-1.0.6
root@server4012:~/mcrypt-1.0.6# /opt/keyhelp/php/7.4/bin/phpize
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
root@server4012:~/mcrypt-1.0.6# ./configure --with-php-config=/opt/keyhelp/php/7.4/bin/php-config
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /opt/keyhelp/php/7.4
checking for PHP includes... -I/opt/keyhelp/php/7.4/include/php -I/opt/keyhelp/php/7.4/include/php/main -I/opt/keyhelp/php/7.4/include/php/TSRM -I/opt/keyhelp/php/7.4/include/php/Zend -I/opt/keyhelp/php/7.4/include/php/ext -I/opt/keyhelp/php/7.4/include/php/ext/date/lib
checking for PHP extension directory... /opt/keyhelp/php/7.4/lib/php/extensions/no-debug-non-zts-20190902
checking for PHP installed headers prefix... /opt/keyhelp/php/7.4/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking for mcrypt support... yes, shared
checking for libmcrypt version... >= 2.5.6
checking for mcrypt_module_open in -lmcrypt... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
root@server4012:~/mcrypt-1.0.6# make
/bin/bash /root/mcrypt-1.0.6/libtool --mode=compile cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/root/mcrypt-1.0.6 -DPHP_ATOM_INC -I/root/mcrypt-1.0.6/include -I/root/mcrypt-1.0.6/main -I/root/mcrypt-1.0.6 -I/opt/keyhelp/php/7.4/include/php -I/opt/keyhelp/php/7.4/include/php/main -I/opt/keyhelp/php/7.4/include/php/TSRM -I/opt/keyhelp/php/7.4/include/php/Zend -I/opt/keyhelp/php/7.4/include/php/ext -I/opt/keyhelp/php/7.4/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/mcrypt-1.0.6/mcrypt.c -o mcrypt.lo
mkdir .libs
cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/root/mcrypt-1.0.6 -DPHP_ATOM_INC -I/root/mcrypt-1.0.6/include -I/root/mcrypt-1.0.6/main -I/root/mcrypt-1.0.6 -I/opt/keyhelp/php/7.4/include/php -I/opt/keyhelp/php/7.4/include/php/main -I/opt/keyhelp/php/7.4/include/php/TSRM -I/opt/keyhelp/php/7.4/include/php/Zend -I/opt/keyhelp/php/7.4/include/php/ext -I/opt/keyhelp/php/7.4/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/mcrypt-1.0.6/mcrypt.c -fPIC -DPIC -o .libs/mcrypt.o
/bin/bash /root/mcrypt-1.0.6/libtool --mode=compile cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/root/mcrypt-1.0.6 -DPHP_ATOM_INC -I/root/mcrypt-1.0.6/include -I/root/mcrypt-1.0.6/main -I/root/mcrypt-1.0.6 -I/opt/keyhelp/php/7.4/include/php -I/opt/keyhelp/php/7.4/include/php/main -I/opt/keyhelp/php/7.4/include/php/TSRM -I/opt/keyhelp/php/7.4/include/php/Zend -I/opt/keyhelp/php/7.4/include/php/ext -I/opt/keyhelp/php/7.4/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/mcrypt-1.0.6/mcrypt_filter.c -o mcrypt_filter.lo
cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/root/mcrypt-1.0.6 -DPHP_ATOM_INC -I/root/mcrypt-1.0.6/include -I/root/mcrypt-1.0.6/main -I/root/mcrypt-1.0.6 -I/opt/keyhelp/php/7.4/include/php -I/opt/keyhelp/php/7.4/include/php/main -I/opt/keyhelp/php/7.4/include/php/TSRM -I/opt/keyhelp/php/7.4/include/php/Zend -I/opt/keyhelp/php/7.4/include/php/ext -I/opt/keyhelp/php/7.4/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/mcrypt-1.0.6/mcrypt_filter.c -fPIC -DPIC -o .libs/mcrypt_filter.o
/bin/bash /root/mcrypt-1.0.6/libtool --mode=link cc -DPHP_ATOM_INC -I/root/mcrypt-1.0.6/include -I/root/mcrypt-1.0.6/main -I/root/mcrypt-1.0.6 -I/opt/keyhelp/php/7.4/include/php -I/opt/keyhelp/php/7.4/include/php/main -I/opt/keyhelp/php/7.4/include/php/TSRM -I/opt/keyhelp/php/7.4/include/php/Zend -I/opt/keyhelp/php/7.4/include/php/ext -I/opt/keyhelp/php/7.4/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -o mcrypt.la -export-dynamic -avoid-version -prefer-pic -module -rpath /root/mcrypt-1.0.6/modules mcrypt.lo mcrypt_filter.lo -lmcrypt -lltdl
cc -shared .libs/mcrypt.o .libs/mcrypt_filter.o /usr/lib/libmcrypt.so -lltdl -Wl,-soname -Wl,mcrypt.so -o .libs/mcrypt.so
creating mcrypt.la
(cd .libs && rm -f mcrypt.la && ln -s ../mcrypt.la mcrypt.la)
/bin/bash /root/mcrypt-1.0.6/libtool --mode=install cp ./mcrypt.la /root/mcrypt-1.0.6/modules
cp ./.libs/mcrypt.so /root/mcrypt-1.0.6/modules/mcrypt.so
cp ./.libs/mcrypt.lai /root/mcrypt-1.0.6/modules/mcrypt.la
PATH="$PATH:/sbin" ldconfig -n /root/mcrypt-1.0.6/modules
----------------------------------------------------------------------
Libraries have been installed in:
/root/mcrypt-1.0.6/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 for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

root@server4012:~/mcrypt-1.0.6# make install
Installing shared extensions: /opt/keyhelp/php/7.4/lib/php/extensions/no-debug-non-zts-20190902/
root@server4012:~/mcrypt-1.0.6# /etc/init.d/keyhelp-php74-fpm restart
Restarting keyhelp-php74-fpm (via systemctl): keyhelp-php74-fpm.service.
root@server4012:~/mcrypt-1.0.6# echo "extension=mcrypt.so" > /opt/keyhelp/php/7.4/etc/conf.d/mcrypt.ini
root@server4012:~/mcrypt-1.0.6# /etc/init.d/keyhelp-php74-fpm restart
Restarting keyhelp-php74-fpm (via systemctl): keyhelp-php74-fpm.service.
User avatar
Florian
Keyweb AG
Posts: 1258
Joined: Wed 20. Jan 2016, 02:28

Re: mcrypt installieren

Post by Florian »

Und du nutzt auch die PHP 7.4 von Keyhelp und nicht eine andere Version?

Die Anleitung ist nur ein Beispiel!!!
Mit freundlichen Grüßen / Best regards
Florian Cheno

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
Post Reply