I was following a tutorial online about installing magento on ubuntu, but when I refresh the page at step 8/9/10(correct writable permissions on files) I get 2 errors: php extension mcrypt must be loaded
and php extension curl must be loaded
I've found some answers online about how to fix it but I cant seem to find any answer that helps me. I'm running Ubuntu 13, apache2 and magento 1.9.0.1. What should I do to fix this?
3 Answers
Depending on your PHP version you should install it using:
sudo apt-get install php5-curl or sudo apt-get install php-curl
and sudo apt-get install php5-mcrypt or sudo apt-get install php-curl
You then need to restart your webserver to make the new php modules load.
-
Now it just says mcrypt has to be loaded O.o. I restarted my webserver– LokoCommented Sep 24, 2014 at 15:31
-
@loko take a look at php.net/manual/en/mcrypt.setup.php You may need to edit your php.ini or created mcrypt.ini in /etc/php5/conf.d and add
extension=mcrypt.so
Commented Sep 24, 2014 at 16:19 -
@R.S I'm kind of new to this, but the extension=mcrypt.so is already in that file. And can you explain me about the php.ini thing?– LokoCommented Sep 26, 2014 at 9:07
-
1@Loko Ubuntu (13.10 and 14.04) has an issue the
mcrypt
extension is not included automatically after installation. See Magento not seeing mcrypt in LAMP for the details and how to fix it. Commented May 14, 2015 at 17:38
Take a look at Ask Unbuntu - How do I install curl in php5?
sudo apt-get install php5-curl php5-mcrypt
You will need to restart the server afterwards:
sudo service apache2 restart
Alternatively, if you are using php-fpm, you'll need to restart php5-fpm instead
sudo service php5-fpm restart
In Ubuntu 16.04 default PHP version is 7.0, if you want to use different version then you need to install PHP package according to PHP version:
First of all Install CURL using this command:-
sudo apt-get install curl
After that using these commands according to your PHP versions:-
1-> PHP 7.0: sudo apt-get install php7.0-curl
2-> PHP 7.1: sudo apt-get install php7.1-curl
3-> PHP 7.2: sudo apt-get install php7.2-curl
4-> PHP 5.5: sudo apt-get install php5.5-curl
5-> PHP 5.6: sudo apt-get install php5.6-curl