Question

Can't install php-xml, php-mbstring etc. in php 7.0

I’m trying to install php7.0-xml, php7.0-mbstring etc. but there’s an error in my centos machine.

sudo yum install php7.0-xml Failed to set locale, defaulting to C Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile

sudo yum install php7.0-mbstring Failed to set locale, defaulting to C Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

On CentOS 7, PHP is still on version 5.4.16, though there are a number of community projects that provide more recent versions. In this case, we’ll use the packages from the IUS Project.

To add their repository, run:

  1. curl 'https://setup.ius.io/' -o setup-ius.sh
  2. sudo bash setup-ius.sh

Now, you can install the packages with:

  1. sudo yum install php70u-xml php70u-mbstring

You can find more details in:

Worked for me. I had to use php72u, though as I am on 7.2. Thanks!