I've been trying to install Magento 2. I did load everything and with the last commands "composer update" or "composer install" I'm having problem.
Problem 1
- The requested PHP extension ext-mcrypt * is missing from your system.
Problem 2
- The requested PHP extension ext-intl * is missing from your system.
The thing is I'm not a pro Mac user or anything so it's very complicated for me to understand what I need to do to resolve this.
I saw a topic here at stackoverflow with the same problem but in that case they were using MAMP. I'm using XAMPP. They were telling to override PHP with MAMP's PHP with the .bash_profile file. I tried the same - didn't quite understand what I was doing.
So please, can anyone help me with solving ext-mcrypt and ext-intl stuff? I don't even know how to find out if they are missin or not.
Thanks!
Here's what in place of mcrypt
[mcrypt]
; For more information about mcrypt settings see http://php.net/mcrypt-module-open
; Directory where to load mcrypt algorithms
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
;mcrypt.algorithms_dir=
; Directory where to load mcrypt modes
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
;mcrypt.modes_dir=
FINAL NOTES:
I marked answer as correct as it resolved my issue with mcrypt with the link from Laravel requires the Mcrypt PHP extension next I had issue with ext-intl and to resolve this please follow these links: http://codingexplained.com/operating-systems/mac/installing-php-intl-extension-os-x-mavericks and Php-intl installation on XAMPP
I did write an article about these issues and solution. hopefully this helps too!
Have a look at this answer Laravel requires the Mcrypt PHP extension and the following one.
If mcrypt is not enabled open your php.ini (see my first answer link above how to find it) and search for
;extension=php_mcrypt.so
then remove the ; from the beginning of that line. Same procedure for the other extension.
On linux I:
sudo apt-get install php7.0-mcrypt ;
sudo apt-get install php7.0-intl
Following things you can check -
Apache Version: 2.2 or 2.4 and Enable: mod_rewrite.mod_rewrite enables the server to perform URL rewriting.
PHP: 5.4.x where x = 11 or later 5.5.x and
Enable PHP Extension: PDO/MySQL,mbstring, mcrypt, mhash, simplexml, curl, gd2, ImageMagick 6.3.7 (or later) or both soap and
add xdebug.max_nesting_level=50000; at php.ini
MySQL Version : 5.6.x and upper
For more info please have a look at this URL -
http://magentostriker.blogspot.in/2015/03/magento-2-installation.html
Hope it will help.
If you are using Linux and PHP 7.0 you would use something like this:
yum install php70u-intl
I have PHP version 70u in the above example. Bu this will provide "ext-intl".
Related
I have set up laravel/homestead, now when I use composer install on a project, I get the error message:
The requested PHP extension mcrypt is missing from your system
(I know I shouldn't use mcrypt anymore, but the project was handed over to me so I cant change this for now)
I m using PHP 7.1 (where mcrypt is marked deprecated I think but still usable if I activate it?)
php -v shows "7.1.30"
I added extension=php_mcrypt.dll into my php.ini and then restarted homestead (halt & up again) I can see the line in the php.ini now but php -m does not show mcrypt... and composer install still fails.
How can I activate mcrypt in homestead?
MCrypt was removed from PHP7 for one of the main reasons why you want to upgrade PHP: Security. The MCrypt library is not maintained anymore. There is no way to fix it on Windows, it's simply not there anymore. You need to change the code or downgrade (not recommended!!!).
I followed the instructions outlined here:
Install PHP Internationalization extension (Intl) on XAMPP on Mac
Ran sudo pecl install intl
selected the correct files from the Cellar
then this error happened:
/private/tmp/pear/temp/intl/intl_error.h:24:10: fatal error:
'ext/standard/php_smart_str.h' file not found
include
^ 1 error generated. make: *** [php_intl.lo] Error 1 ERROR: `make' failed
No matter, did some research and found out that PHP 7.0.8 deprecated php.smart_str.h to php.smart_string.h
So given my scant knowledge of C++ I copied smart_string.h to smart_str.h and renamed all the headers from STRING to string.....
re-ran pecl -no luck....more errors......without knowing where the .c files are and remaking php (not really interested in going that far) since anyway I'm using XAMPP so that ended that option.
I have php 5.5 on my mac, deep in the usr/local/bin folder
so next step was to get pecl to use those files and generate an intl.so file....
Did that....I have the intl.so file so put it in the 'extensions' folder in XAMPP (for reference: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012)
Ran php and came up with this error:
Warning: PHP Startup: Unable to load dynamic library
'/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so'
- dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so,
9): Symbol not found: _zval_used_for_init Referenced from:
/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so
Expected in: flat namespace in
/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so
in Unknown on line 0
I imagine it has to do with different versions?
In any case I can't get pecl to install intl without a make error in PHP 7.0.8 on XAMPP. There is no documentation on this and you'd think that if you deprecate a header.h file you'd update all extensions?
Install intl.so in PHP 7 seems impossible?
After a lot of research I was finally able to resolve this. Detailed steps here:
before you begin, check which php path is set. it should be /Applications/XAMPP/xamppfiles/bin/php. If not you can change it by PATH="/Applications/XAMPP/xamppfiles/bin:${PATH}". more detail here
Overall idea is to build the intl-extension from PHP source code on your own. Before you begin make sure you have installed Xcode. Also, install the latest version of autoconf. this might help:
brew install autoconf
Next download the version of PHP you use in XAMPP from php.net. I am using 7.1.18. This version worked for me: php-7.1.31, I’m guessing if you follow the steps it might work for 7.0 or 7.2 as well. Do let me know if it does or doesnt, I’ll update this post. Do not use PHP 7.3 for Magento 2.3.0, it is not supported.
Extract the tar.gz file using (I extracted it inside ~/Downloads/ folder )
tar -xzvf php-7.1.31.tar.gz
cd into the extracted folder
cd php-7.1.31
change to subfolder ext/intl
cd ext/intl/
Run these commands to build the extension
/Applications/XAMPP/bin/phpize
./configure --enable-intl --with-php-config=/Applications/XAMPP/bin/php-config --with-icu-dir=/Applications/XAMPP/xamppfiles/
make
sudo make install
you can now delete all files you downloaded and also the extracted folders.
Open /Applications/XAMPP/xamppfiles/etc/php.ini , and add extension=intl.so
Restart your Apache using XAMPP GUI and it should work.
So far, it seems that extension intl.so for php is bundled with php
and should be compiled with php (intl --enabled). XAMPP does not support this (as of Oct 2016), MAMP does. I do not know about other distros. However, if you're willing to recompile PHP 7, it's worth it just to do that and enable it during compiling.
So....I ran with MAMP. Then I decided that I would simply install apache 2.4 and php 7 and Mysql without the stack and the junk that comes with MAMP or XAMPP and everything works like a charm... so if you need to use CakePHP or intl support etc... just drop XAMPP/MAMP and go with a standard install. I used homebrew (MacOS) and everything is working fine.
Update: As regards Windows, XAMPP does not default it, but you can add the module (dll) in php.ini and works like a charm
The error means that XAMPP doesn't have PHP compiled with intl. You may try:
pecl install intl
but probably it won't work as well.
See: PHP Bug #72879 Pecl install intl make error with PHP 7.0.8.
As for the workaround, try installing memcached extension instead of memcache, e.g.
pecl install memcached
Note: It also requires libmemcached package/library to be installed beforehand. For macOS, install via: brew install libmemcached.
If you wanna try without homebrew, with native apache and php, look at my aswer here: https://stackoverflow.com/a/55131868/3692846
I need to encrypt passwords and some other data in my PHP(5.5.9) application on Ubuntu (14.04) server. I read about libsodium and found it a good fit for the applications requirements. I followed all the instructions given in the only tutorial available for libsoidum.
sudo add-apt-repository ppa:chris-lea/libsodium - Done, no errors
sudo apt-get update && sudo apt-get install libsodium-dev - Done, no errors
pecl install libsodium - Done, no errors
added extension=libsodium.so to php.ini and restarted apache.
When I check phpinfo() page I am able to see the entry for libsodium as follows:
libsodium support enabled
libsodium compiled version 1.0.6
libsodium headers version 1.0.3
libsodium library version 1.0.3
However, when I try to run the basic example given in the above tutorial which is:
<?php var_dump([ \Sodium\library_version_major(),\\Sodium\library_version_minor(),\Sodium\version_string() ]);?>
I get an error saying "Call to undefined function Sodium\library_version_major()".
This is really baffling me as the extension is identified correctly by phpinfo() page.
Can anyone please help me in understanding if I am missing something or doing wrong that I am not able to use libsodium with php. Any help is greatly appreciated.
Thank you.
I assume that you've tried to run the basic example from the command line. In this case it is necessary to not only add extension=libsodium.so to the php.ini of apache2 that is found at /etc/php5/apache2/php.ini on Ubuntu 14.04.
Additional it is necessary to add this line to the php.ini file for the cli environment found at /etc/php5/cli/php.ini.
I've been trying to install Magento 2. I did load everything and with the last commands "composer update" or "composer install" I'm having problem.
Problem 1
- The requested PHP extension ext-mcrypt * is missing from your system.
Problem 2
- The requested PHP extension ext-intl * is missing from your system.
The thing is I'm not a pro Mac user or anything so it's very complicated for me to understand what I need to do to resolve this.
I saw a topic here at stackoverflow with the same problem but in that case they were using MAMP. I'm using XAMPP. They were telling to override PHP with MAMP's PHP with the .bash_profile file. I tried the same - didn't quite understand what I was doing.
So please, can anyone help me with solving ext-mcrypt and ext-intl stuff? I don't even know how to find out if they are missin or not.
Thanks!
Here's what in place of mcrypt
[mcrypt]
; For more information about mcrypt settings see http://php.net/mcrypt-module-open
; Directory where to load mcrypt algorithms
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
;mcrypt.algorithms_dir=
; Directory where to load mcrypt modes
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
;mcrypt.modes_dir=
FINAL NOTES:
I marked answer as correct as it resolved my issue with mcrypt with the link from Laravel requires the Mcrypt PHP extension next I had issue with ext-intl and to resolve this please follow these links: http://codingexplained.com/operating-systems/mac/installing-php-intl-extension-os-x-mavericks and Php-intl installation on XAMPP
I did write an article about these issues and solution. hopefully this helps too!
Have a look at this answer Laravel requires the Mcrypt PHP extension and the following one.
If mcrypt is not enabled open your php.ini (see my first answer link above how to find it) and search for
;extension=php_mcrypt.so
then remove the ; from the beginning of that line. Same procedure for the other extension.
On linux I:
sudo apt-get install php7.0-mcrypt ;
sudo apt-get install php7.0-intl
Following things you can check -
Apache Version: 2.2 or 2.4 and Enable: mod_rewrite.mod_rewrite enables the server to perform URL rewriting.
PHP: 5.4.x where x = 11 or later 5.5.x and
Enable PHP Extension: PDO/MySQL,mbstring, mcrypt, mhash, simplexml, curl, gd2, ImageMagick 6.3.7 (or later) or both soap and
add xdebug.max_nesting_level=50000; at php.ini
MySQL Version : 5.6.x and upper
For more info please have a look at this URL -
http://magentostriker.blogspot.in/2015/03/magento-2-installation.html
Hope it will help.
If you are using Linux and PHP 7.0 you would use something like this:
yum install php70u-intl
I have PHP version 70u in the above example. Bu this will provide "ext-intl".
I try to install the sandbox but I get the following error from composer:
Loading composer repositories with package information Installing
dependencies from lock file Your requirements could not be resolved to
an installable set of packages.
Problem 1
- Installation request for sonata-project/intl-bundle 2.1.0 -> satisfiable by sonata-project/intl-bundle 2.1.0.`
- sonata-project/intl-bundle 2.1.0 requires ext-intl * -> the requested PHP extension intl is missing from your system.`
Problem 2
- sonata-project/intl-bundle 2.1.0 requires ext-intl * -> the requested PHP extension intl is missing from your system.`
- sonata-project/news-bundle 2.1.x-dev requires sonata-project/intl-bundle 2.1.* -> satisfiable by sonata-project/intl-bundle 2.1.0.
- Installation request for sonata-project/news-bundle 2.1.
I had the same problem while I was installing new Magento 2.0, after different hit and trials, I manged to solve it by following these steps:
I copied all icu* files from php directory to Appache directory, and it worked.
Php direcotry:
WAMP\bin\php\php5.5.12
Appache Directory:
WAMP\bin\apache\apache2.4.9
Make sure to un-comment following line in php.ini file:
extension=ext/php_intl.dll
Linux user
yum install php-intl
Like #Hugehornet pointed out - you should enable this extension in php.ini by uncommenting this line: extension=ext/php_intl.dll
If you use wamp's interface for this task you are actually updating the php.ini file located in apache's directory.
Example: C:\wamp\bin\apache\Apache2.4.4\bin\php.ini
Composer is using the one located in the php's installation directory.
Example: C:\wamp\bin\php\php5.4.12\php.ini
You should manually edit the latter and restart the wamp server.
You need to enable the intl extension in php just as the error says.
In your php.ini file, uncomment the line extension=ext/php_intl.dll or something like this.
Edit : note that if you are using wamp or something like this, you should be aware of the fact that the php.ini file in the wamp config is not necessarily the one used by composer.
First of all be sure that your server is isung x86 build (intl not working with x64), then:
activate intl extension in php.ini directly
copy all icu*.dll form php directory to apache directory
make sure your console using the same php folder you just configured
source.
In my windows system I have two php.ini files at the flowing paths:
C:\wamp\bin\php\phpx.y.z
C:\wamp\bin\apache\Apachex.y.z\bin
I don't know which one is in your path. Just make sure to add the extension in both of them to eliminate any doubt.
I am on a Mac OS X Yosemite, and I fix this error
the requested PHP extension mcrypt is missing from your system
by running the following commands :
brew update
brew upgrade
brew tap homebrew/dupes
brew tap josegonzalez/homebrew-php
brew install php54-mcrypt
If intl has already been enabled and it doesn't works, add your PHP directory in the Path environment variable, then restart your server.
(for example C:\Program Files\wamp\bin\php\phpX.XXX.XXX for wamp)
It has worked for me!
On Ubuntu, Debian, and related Linux distributions
sudo apt-get install php-intl
to install the extension for the default PHP version.
For other versions a variation like apt-get install php7.3-intl will choose the correct extension if the version provided is correct.