"CentOS php-mcrypt 설치"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(사용자 3명의 중간 판 32개는 보이지 않습니다)
1번째 줄: 1번째 줄:
phpMyAdmin
{{다른뜻|우분투 php-mcrypt 설치}}
{{테스트|Red Hat, CentOS 6}}
;how to install php-mcrypt on CentOS 6
;PHP Mcrypt on CentOS 6
;The mcrypt extension is missing. Please check your PHP configuration.
;php-mcrypt 설치


<source lang='text'>
==문제상황 1: phpMyAdmin==
phpMyAdmin에서 아래와 같은 경고 메시지가 나온다.
<syntaxhighlight lang='text'>
The mcrypt extension is missing. Please check your PHP configuration.
The mcrypt extension is missing. Please check your PHP configuration.
</source>
</syntaxhighlight>
php-mcrypt 모듈이 없어서 그렇다.


==php-mcypt 확인==
==문제상황 2: php==
;확인
PHP에서 mcrypt 함수를 사용하고 싶은데 안된다.
<source lang='dos'>
<syntaxhighlight lang='text'>
[root@localhost ~]# yum info php-mcrypt
Fatal error: Call to undefined function mcrypt_create_iv()
Loaded plugins: security
</syntaxhighlight>
Excluding Packages in global exclude list
 
Finished
==확인==
Reducing CentOS-5 Testing to included packages only
<syntaxhighlight lang='console'>
Finished
[root@zetawiki ~]# php -r "mcrypt_create_iv();"
Available Packages
PHP Fatal error: Call to undefined function mcrypt_create_iv() in Command line code on line 1
Name      : php-mcrypt
 
Arch      : x86_64
Fatal error: Call to undefined function mcrypt_create_iv() in Command line code on line 1
Version    : 5.2.9
</syntaxhighlight>
Release    : 2.el5.centos.3
:→ mcrypt_create_iv 함수를 인식하지 못한다.
Size      : 16 k
<syntaxhighlight lang='console'>
Repo      : c5-testing
[root@zetawiki ~]# php -m | grep mcrypt
Summary    : Standard PHP module provides mcrypt library support
[root@zetawiki ~]# rpm -qa | grep mcrypt
URL        : http://www.php.net/
[root@zetawiki ~]#
License    : PHP
</syntaxhighlight>
Description: Standard PHP module provides mcrypt library support
:→ 설치 안됨.
</source>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# yum list php-mcrypt
... (생략)
Error: No matching Packages to list
</syntaxhighlight>
:→ CentOS 기본 yum 저장소에는 없음
 
==epel-release 설치==
{{참고|epel-release 설치}}


==php-mcypt 설치==
==php-mcypt 설치==
<source lang='dos'>
<syntaxhighlight lang='console'>
[root@localhost ~]# yum install php-mcrypt -y
[root@zetawiki ~]# yum install php-mcrypt
... (생략)
... (생략)
=======================================================================================================
==================================================================================================================
  Package               Arch             Version                           Repository             Size
  Package                     Arch                     Version                       Repository             Size
=======================================================================================================
==================================================================================================================
Installing:
Installing:
  php-mcrypt           x86_64           5.2.9-2.el5.centos.3              c5-testing            16 k
  php-mcrypt                   x86_64                   5.3.3-1.el6                  epel                    18 k
Installing for dependencies:
libmcrypt                    x86_64                  2.5.8-9.el6                  epel                    96 k


Transaction Summary
Transaction Summary
=======================================================================================================
==================================================================================================================
Install      1 Package(s)
Install      2 Package(s)
Upgrade      0 Package(s)


Total download size: 16 k
Total download size: 114 k
Downloading Packages:
Installed size: 326 k
php-mcrypt-5.2.9-2.el5.centos.3.x86_64.rpm                                      |  16 kB    00:00
Is this ok [y/N]: y
Running rpm_check_debug
</syntaxhighlight>
Running Transaction Test
<syntaxhighlight lang='console'>
Finished Transaction Test
... (생략)
Transaction Test Succeeded
Installed:
Running Transaction
   php-mcrypt.x86_64 0:5.3.3-1.el6                                                                               
   Installing    : php-mcrypt                                                                     1/1


Installed:
Dependency Installed:
   php-mcrypt.x86_64 0:5.2.9-2.el5.centos.3
   libmcrypt.x86_64 0:2.5.8-9.el6                                                                                 


Complete!
Complete!
</source>
</syntaxhighlight>
 
==확인 2==
<syntaxhighlight lang='console'>
[root@zetawiki ~]# php -m | grep mcrypt
mcrypt
</syntaxhighlight>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# rpm -qa | grep mcrypt
php-mcrypt-5.3.3-1.el6.x86_64
libmcrypt-2.5.8-9.el6.x86_64
</syntaxhighlight>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# php -r "mcrypt_create_iv();"
PHP Warning:  mcrypt_create_iv() expects at least 1 parameter, 0 given in Command line code on line 1
 
Warning: mcrypt_create_iv() expects at least 1 parameter, 0 given in Command line code on line 1
</syntaxhighlight>
:→ mcrypt_create_iv 함수가 인식되었다.
 
==아파치 재시작==
*웹에도 적용되게 하기 위해서는 httpd를 재시작해야 한다.
<syntaxhighlight lang='console'>
[root@zetawiki ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
</syntaxhighlight>
*이제 phpMyAdmin에서도 경고 메시지가 사라졌을 것이다.


==참고 자료==
==같이 보기==
*[[epel-release 설치]]
*[[PhpMyAdmin 설치]]
*[[PHP Fatal error]]
*[[python-mcrypt 설치]]
 
==참고==
*http://www.linuxquestions.org/questions/red-hat-31/cannot-load-mcrypt-extension-please-check-your-php-configuration-672627/
*http://www.linuxquestions.org/questions/red-hat-31/cannot-load-mcrypt-extension-please-check-your-php-configuration-672627/
*http://www.mojowill.com/geek/php-mcrypt-on-centos-6/
*http://blog.naver.com/PostView.nhn?blogId=saibi4&logNo=30159951929
[[분류: PHP 오류]]
[[분류: phpMyAdmin]]
[[분류: yum 설치]]

2020년 11월 2일 (월) 02:56 기준 최신판

  다른 뜻에 대해서는 우분투 php-mcrypt 설치 문서를 참조하십시오.
how to install php-mcrypt on CentOS 6
PHP Mcrypt on CentOS 6
The mcrypt extension is missing. Please check your PHP configuration.
php-mcrypt 설치

1 문제상황 1: phpMyAdmin[ | ]

phpMyAdmin에서 아래와 같은 경고 메시지가 나온다.

The mcrypt extension is missing. Please check your PHP configuration.

php-mcrypt 모듈이 없어서 그렇다.

2 문제상황 2: php[ | ]

PHP에서 mcrypt 함수를 사용하고 싶은데 안된다.

Fatal error: Call to undefined function mcrypt_create_iv()

3 확인[ | ]

[root@zetawiki ~]# php -r "mcrypt_create_iv();"
PHP Fatal error:  Call to undefined function mcrypt_create_iv() in Command line code on line 1

Fatal error: Call to undefined function mcrypt_create_iv() in Command line code on line 1
→ mcrypt_create_iv 함수를 인식하지 못한다.
[root@zetawiki ~]# php -m | grep mcrypt
[root@zetawiki ~]# rpm -qa | grep mcrypt
[root@zetawiki ~]#
→ 설치 안됨.
[root@zetawiki ~]# yum list php-mcrypt
... (생략)
Error: No matching Packages to list
→ CentOS 기본 yum 저장소에는 없음

4 epel-release 설치[ | ]

5 php-mcypt 설치[ | ]

[root@zetawiki ~]# yum install php-mcrypt
... (생략)
==================================================================================================================
 Package                      Arch                     Version                       Repository              Size
==================================================================================================================
Installing:
 php-mcrypt                   x86_64                   5.3.3-1.el6                   epel                    18 k
Installing for dependencies:
 libmcrypt                    x86_64                   2.5.8-9.el6                   epel                    96 k

Transaction Summary
==================================================================================================================
Install       2 Package(s)

Total download size: 114 k
Installed size: 326 k
Is this ok [y/N]: y
... (생략)
Installed:
  php-mcrypt.x86_64 0:5.3.3-1.el6                                                                                 

Dependency Installed:
  libmcrypt.x86_64 0:2.5.8-9.el6                                                                                  

Complete!

6 확인 2[ | ]

[root@zetawiki ~]# php -m | grep mcrypt
mcrypt
[root@zetawiki ~]# rpm -qa | grep mcrypt
php-mcrypt-5.3.3-1.el6.x86_64
libmcrypt-2.5.8-9.el6.x86_64
[root@zetawiki ~]# php -r "mcrypt_create_iv();"
PHP Warning:  mcrypt_create_iv() expects at least 1 parameter, 0 given in Command line code on line 1

Warning: mcrypt_create_iv() expects at least 1 parameter, 0 given in Command line code on line 1
→ mcrypt_create_iv 함수가 인식되었다.

7 아파치 재시작[ | ]

  • 웹에도 적용되게 하기 위해서는 httpd를 재시작해야 한다.
[root@zetawiki ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
  • 이제 phpMyAdmin에서도 경고 메시지가 사라졌을 것이다.

8 같이 보기[ | ]

9 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}