Upgrading from php5 to php7 utf8 locale error

July 20, 2016 2.8k views
PHP Apache

After trying everything I could possibly find I am unable to solve my issue

I am following this tutorial on DO https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-php-7-on-ubuntu-14-04 on how to upgrade from php5 to php7

The problem: Immediately on the first step when I execute “add-apt-repository ppa:ondrej/php”

I am given a warning error
add-apt-repository is broken with non-uft-locales see xxxxxx.com

I already tried
apt-get install -y language-pack-en-base
LCALL=enUS.UTF-8 add-apt-repository ppa:ondrej/php

1 Answer

Here’s a summary from a solution from Sakshi’s Oracle blog that works for Ubuntu:

sudo locale-gen en_US.UTF-8
sudo dpkg-reconfigure locales

then edit /etc/default/locale and add LC_ALL and LANGUAGE with values “en_US.UTF-8”, like this


Now try the locale command.

  • hmm no luck, here is a screenshot of what I am seeing


    • The instructions I posted used en_US, as you’re original error suggested, instead of C.UTF-8. To see all locale that are available, on the command line try:

      locale -a

      If the C.UTF-8 locale doesn’t show, then you’ll have to use that string instead of en_US in the instructions I previously provided.

Have another answer? Share your knowledge.