34

I am trying to install yii2 on my Amazon Linux AMI instance, it requires the php-mbstring extension to work.

When I tried to run sudo yum install php-mbstring it returned this error:

Error: php56-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64

Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main/latest                                         | 2.1 kB     00:00
amzn-updates/latest                                      | 2.3 kB     00:00
2494 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package php-mbstring.x86_64 0:5.3.29-1.8.amzn1 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.29-1.8.amzn1 for package: php-mbstring-5.3.29-1.8.amzn1.x86_64
--> Running transaction check
---> Package php-common.x86_64 0:5.3.29-1.8.amzn1 will be installed
--> Processing Conflict: php56-common-5.6.9-1.112.amzn1.x86_64 conflicts php-common < 5.5.22-1.98
--> Finished Dependency Resolution
Error: php56-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

Thanks for your time in advance

Alex Andrei
  • 7,315
  • 3
  • 28
  • 42
Bob Lin
  • 343
  • 1
  • 4
  • 7
  • 5.5 and 5.3?... And 5.6? Can you not find packages with matching versions? – ficuscr Jul 02 '15 at 17:15
  • On Amazon Linux, PHP versions from 5.4 and on are set up to run side by side. Use alternatives to set the active version. – datasage Jul 02 '15 at 17:29

2 Answers2

85

It seems you have php 5.6 installed.
You need to install mbstring for that particular version of php.

Run sudo yum install php56-mbstring

After that it might be a good idea to restart apache (thanks! @hexicle),
using sudo service httpd restart

Community
  • 1
  • 1
Alex Andrei
  • 7,315
  • 3
  • 28
  • 42
2

Amazon Linux AMI release 2017.09

sudo yum install php70-mysqlnd
sudo service httpd restart
Paul Roub
  • 36,322
  • 27
  • 84
  • 93
Victorio Berra
  • 2,760
  • 2
  • 28
  • 53