program tip

Ubuntu를 13.10으로 업그레이드 한 후 mCrypt가 없음

radiobox 2020. 8. 31. 07:38
반응형

Ubuntu를 13.10으로 업그레이드 한 후 mCrypt가 없음


시스템을 Ubuntu 13.04에서 13.10으로 업그레이드 한 후 apache, mysql 및 php 구성에 몇 가지 문제가 발생했습니다.

나는 그들 중 대부분을 해결했지만 mCrypt 라이브러리가 작동하지 않는 것 같습니다. 패키지가 설치되어 있으므로 apt-get 할 필요가 없습니다. 서버가 작동하고 모든 것이 괜찮아 보이지만 php artisan serveLaravel 4 로 실행하려고하면 mCrypt가 필요하다는 메시지가 표시됩니다.

내가 그랬어 php --ri mcrypt출력이었다 Extension 'mcrypt' not present.내가 퍼팅 시도 extension=mcrypt.so/etc/php5/apache2/php.ini하지만 그것은 작동하지 않았다.

어떤 아이디어?

출력 dpkg --get-selections | grep php5

libapache2-mod-php5         install
php5                        install
php5-cli                    install
php5-common                 install
php5-gd                     install
php5-json                   install
php5-mcrypt                 install
php5-mysql                  install
php5-readline               install

나는 launchpad.net 에서 해결책을 찾은 것 같습니다 .

그래서:

sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available
sudo php5enmod mcrypt
sudo service apache2 restart

이것은 나를 위해 일했습니다. 다른 사람들에게도 도움이되기를 바랍니다.


Ubuntu 14.04에서이 문제가 발생했으며 해결하기 위해 다음을 수행했습니다.

sudo apt-get install php5-mcrypt
sudo php5enmod mcrypt

sudo service apache2 restart

설치 후 Ubuntu 14.04 에서도이 문제가 있습니다.

먼저 mcrypt를 활성화하십시오.

sudo gedit /etc/php5/apache2/php.ini

이 명령을 아무 줄 에나 추가하십시오.

extension=mcrypt.so

/ etc / php5에 conf.d 폴더 생성

sudo mkdir conf.d

그리고 그 폴더 안에 mcrypt.ini 파일을 만듭니다.

sudo gedit mcrypt.ini 

그런 다음이 명령을 해당 파일에 추가하십시오.

extension=mcrypt.so

그런 다음 파일에 대한 링크를 만듭니다.

sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available

mcrypt 모듈 활성화

sudo php5enmod mcrypt

Apache 다시 시작

sudo service apache2 restart

Ubuntu 13.10에서 14.04까지 :

sudo php5enmod mcrypt
sudo service apache2 restart

나를 위해 작동합니다.


또한 Ubuntu 14.04 및 Nginx 에서도이 문제가 있었지만 FPM 서비스를 다시 시작하는 것이 팁이므로 다음과 같이했습니다.

라이브러리 설치

apt-get 설치 php5-mcrypt

경로 찾기

updatedb && mcrypt.so 찾기

/etc/php5/mods-available/mcrypt.ini에있는 mcrypt.ini 파일에서 mcrypt.so의 경로를 설정하십시오.

확장자 = / usr / lib / php5 / 20121212 / mcrypt.so

그런 다음 FPM 서비스를 다시 시작하십시오.

서비스 php5-fpm 다시 시작


패키지가 이미 설치된 경우 다른 솔루션 :

sudo aptitude reinstall php5-mycript

이것은 업그레이드 후 나를 위해 일했습니다.


이 코드를 시도하십시오.

ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/apache2/conf.d/20-mcrypt.ini
service apache2 restart

I had the same problem with PHP 5.5.14 running on Mac OS X Yosemite. I was trying to install Laravel 5.0. And when I tried to create a new project I got an error like below (even when I tried to start the laravel server with php artisan serve

Alejandros-MacBook-Pro:Documents Lexynux$ laravel new blog
Crafting application...
PHP Notice:  Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128' in /Library/WebServer/Documents/blog/config/app.php on line 83
PHP Notice:  Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128' in /Library/WebServer/Documents/blog/config/app.php on line 83
Generating optimized class loader
Compiling common classes
Compiling views
PHP Notice:  Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128' in /Library/WebServer/Documents/blog/config/app.php on line 83
Application key [CCOPocoMjnJTx4AFXk64wqyTKyo3BlHq] set successfully.
Application ready! Build something amazing.
Alejandros-MacBook-Pro:Documents Lexynux$ 

So I just added the line below at the end of my php.ini file with the nano editor:

extension=mcrypt.so
sudo nano /etc/php.ini

Finally just restart the Terminal and restart the laravel app server with

php artisan serve

And it works fine!


just found on php.net

Note, for Ubuntu, simply installing php5-mcrypt did not get mcrypt to work. You need to execute the following commands as root to enable it:

apt-get install php5-mcrypt
mv -i /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/
php5enmod mcrypt
service apache2 restart

http://php.net/manual/en/mcrypt.installation.php#114609


Sometimes, this "problem" occurs because you entered an artisan command on your local machine instead of on your virtual machine. If you are using Homestead, mcrypt is already installed. Consider it a reminder to homestead ssh

참고URL : https://stackoverflow.com/questions/19446679/mcrypt-not-present-after-ubuntu-upgrade-to-13-10

반응형