2

I'm using Ubuntu 14.04 and I'm trying to install PHP 7. I'm doing something wrong. I followed these directions.

If I type 'php -v' in terminal it shows php 7.

However, if I look at my phpinfo() the output still shows my old php 5.

Now when I try to install something that requires php 7 I get the following error:

    Your requirements could not be resolved to an installable set of packages.

        Problem 1
          - Installation request for alchemy/zippy 0.3.5 -> satisfiable by 
alchemy/zippy[0.3.5].
          - alchemy/zippy 0.3.5 requires ext-mbstring * -> the requested PHP 
extension mbstring is missing from your system.
        Problem 2
          - Installation request for easyrdf/easyrdf 0.9.1 -> satisfiable by 
easyrdf/easyrdf[0.9.1].
          - easyrdf/easyrdf 0.9.1 requires ext-mbstring * -> the requested 
PHP extension mbstring is missing from your system.
        Problem 3
          - Installation request for phpunit/phpunit 4.8.27 -> satisfiable by
 phpunit/phpunit[4.8.27].
          - phpunit/phpunit 4.8.27 requires ext-dom * -> the requested PHP 
extension dom is missing from your system.
        Problem 4
          - alchemy/zippy 0.3.5 requires ext-mbstring * -> the requested PHP 
extension mbstring is missing from your system.
          - drupal/console 0.11.3 requires alchemy/zippy 0.3.5 -> satisfiable
 by alchemy/zippy[0.3.5].
          - Installation request for drupal/console 0.11.3 -> satisfiable by 
drupal/console[0.11.3].

        To enable extensions, verify that they are enabled in those .ini 
files:
          - /etc/php/7.0/cli/php.ini
          - /etc/php/7.0/cli/conf.d/10-mysqlnd.ini
          - /etc/php/7.0/cli/conf.d/10-opcache.ini
          - /etc/php/7.0/cli/conf.d/10-pdo.ini
          - /etc/php/7.0/cli/conf.d/20-calendar.ini
          - /etc/php/7.0/cli/conf.d/20-ctype.ini
          - /etc/php/7.0/cli/conf.d/20-exif.ini
          - /etc/php/7.0/cli/conf.d/20-fileinfo.ini
          - /etc/php/7.0/cli/conf.d/20-ftp.ini
          - /etc/php/7.0/cli/conf.d/20-gd.ini
          - /etc/php/7.0/cli/conf.d/20-gettext.ini
          - /etc/php/7.0/cli/conf.d/20-iconv.ini
          - /etc/php/7.0/cli/conf.d/20-json.ini
          - /etc/php/7.0/cli/conf.d/20-mysqli.ini
          - /etc/php/7.0/cli/conf.d/20-pdo_mysql.ini
          - /etc/php/7.0/cli/conf.d/20-phar.ini
          - /etc/php/7.0/cli/conf.d/20-posix.ini
          - /etc/php/7.0/cli/conf.d/20-readline.ini
          - /etc/php/7.0/cli/conf.d/20-shmop.ini
          - /etc/php/7.0/cli/conf.d/20-sockets.ini
          - /etc/php/7.0/cli/conf.d/20-sysvmsg.ini
          - /etc/php/7.0/cli/conf.d/20-sysvsem.ini
          - /etc/php/7.0/cli/conf.d/20-sysvshm.ini
          - /etc/php/7.0/cli/conf.d/20-tokenizer.ini
        You can also run `php --ini` inside terminal to see which files are
 used by PHP in CLI mode.

Anyone have any idea what I need to fix to run php 7 on my system?

8

The error output you have pasted says it all - you are missing mbstring and dom extensions. Those can be installed using:

sudo apt-get install php7.0-dom php7.0-mbstring

The packages with PHP extensions have correct Provides: field, so right packages will be chosen.

  • This answer helped me. My environment was Ubuntu 14.04 and php version was 5.5.9 – Nouphal.M Jan 10 '17 at 13:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.