# PHP 7 vs 5.6 in Ubuntu 14.04

**URL:** <https://www.phphelp.com/t/php-7-vs-5-6-in-ubuntu-14-04/25374>\
**Category:** PHP Installation and Configuration\
**Created:** [August 3, 2016, 11:26pm UTC](https://www.phphelp.com/t/php-7-vs-5-6-in-ubuntu-14-04/25374 "2016-08-03T23:26:49Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sxcd1](https://www.phphelp.com/letter_avatar_proxy/v4/letter/s/f6c823/32.png) [@Sxcd1](https://www.phphelp.com/u/Sxcd1)\
**Post date:** [August 3, 2016, 11:26pm UTC](https://www.phphelp.com/t/php-7-vs-5-6-in-ubuntu-14-04/25374/1 "2016-08-03T23:26:49Z")

</div>

I’m new to php and I’m having problems which I think is related to php versions. I’m getting errors with composer saying

```auto
 is missing from your system. Install or enable PHP's gd extension.
  Problem 3
    - The requested PHP extension ext-mbstring * is missing from your system. Install or enable PHP's mbstring extension.
  Problem 4
    - The requested PHP extension ext-mcrypt * is missing from your system. Install or enable PHP's mcrypt extension.
  Problem 5
    - The requested PHP extension ext-mysqlnd * is missing from your system. Install or enable PHP's mysqlnd extension.
  Problem 6
    - The requested PHP extension ext-pdo_mysql * is missing from your system. Install or enable PHP's pdo_mysql extension.
  Problem 7
    - The requested PHP extension ext-simplexml * is missing from your system. Install or enable PHP's simplexml extension.
  Problem 8
    - The requested PHP extension ext-xmlwriter * is missing from your system. Install or enable PHP's xmlwriter extension.[/code]
This is what I've done to install php
[code]sudo add-apt-repository ppa:ondrej/php5-5.6
sudo apt-get install -y language-pack-en-base
sudo apt-get update
sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php                                                         
sudo apt-get update                                               
sudo apt-get install php5.6
sudo apt-get install php5 php5-cli php5-dev php5-json php-pear php5-gd php5-mysqlnd php5-curl
sudo ln -sfn /usr/bin/php5.6 /etc/alternatives/php

```

```php
PHP 5.6.24-1+deb.sury.org~trusty+1 (cli) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

```

I have no idea what the problem is as I believe I have the required extensions installed. Any help would be appreciated (assume I know nothing).

---

<div class="post-metadata">

**Author:** ![astonecipher](https://www.phphelp.com/user_avatar/www.phphelp.com/astonecipher/32/2797_2.png) [@astonecipher](https://www.phphelp.com/u/astonecipher)\
**Post date:** [August 4, 2016, 12:02am UTC](https://www.phphelp.com/t/php-7-vs-5-6-in-ubuntu-14-04/25374/2 "2016-08-04T00:02:34Z")

</div>

Are you trying to install PHP 7? Do you have a /var/www directory where you can create a php file with just

[php]\<?php  
phpinfo();[/php]

And check if those errors are actually installed?

---

<div class="post-metadata">

**Author:** ![Sxcd1](https://www.phphelp.com/letter_avatar_proxy/v4/letter/s/f6c823/32.png) [@Sxcd1](https://www.phphelp.com/u/Sxcd1)\
**Post date:** [August 4, 2016, 12:56am UTC](https://www.phphelp.com/t/php-7-vs-5-6-in-ubuntu-14-04/25374/3 "2016-08-04T00:56:29Z")

</div>

so I should create a file info.php and place that code into it and then type the ipaddress/info.php into my browser?  
I had previous done the above and didn’t get anything to show up I don’t remember the error msg in the browser.

---

<div class="post-metadata">

**Author:** ![astonecipher](https://www.phphelp.com/user_avatar/www.phphelp.com/astonecipher/32/2797_2.png) [@astonecipher](https://www.phphelp.com/u/astonecipher)\
**Post date:** [August 4, 2016, 1:28am UTC](https://www.phphelp.com/t/php-7-vs-5-6-in-ubuntu-14-04/25374/4 "2016-08-04T01:28:43Z")

</div>

Run it and give us the error message of there is one

---

<div class="post-metadata">

**Author:** ![Sxcd1](https://www.phphelp.com/letter_avatar_proxy/v4/letter/s/f6c823/32.png) [@Sxcd1](https://www.phphelp.com/u/Sxcd1)\
**Post date:** [August 4, 2016, 11:28am UTC](https://www.phphelp.com/t/php-7-vs-5-6-in-ubuntu-14-04/25374/5 "2016-08-04T11:28:20Z")

</div>

File not found.  
[http://192.168.1.20/info.php](http://192.168.1.20/info.php) where 192.168.1.20 is the ip of the server and info.php is saved in /var/www directory.

---

<div class="post-metadata">

**Author:** ![astonecipher](https://www.phphelp.com/user_avatar/www.phphelp.com/astonecipher/32/2797_2.png) [@astonecipher](https://www.phphelp.com/u/astonecipher)\
**Post date:** [August 4, 2016, 11:35am UTC](https://www.phphelp.com/t/php-7-vs-5-6-in-ubuntu-14-04/25374/6 "2016-08-04T11:35:34Z")

</div>

localhost/info.php or 127.0.0.1/info.php

And is your apache service running?

---

<div class="post-metadata">

**Author:** ![Sxcd1](https://www.phphelp.com/letter_avatar_proxy/v4/letter/s/f6c823/32.png) [@Sxcd1](https://www.phphelp.com/u/Sxcd1)\
**Post date:** [August 4, 2016, 9:30pm UTC](https://www.phphelp.com/t/php-7-vs-5-6-in-ubuntu-14-04/25374/7 "2016-08-04T21:30:30Z")

</div>

I’m running nginx and it appears to be running.  
nginx version: nginx/1.10.1

`sudo service nginx restart
nginx stop/waiting
nginx stop/pre-start, process 2730
`

---

<div class="post-metadata">

**Author:** ![Sxcd1](https://www.phphelp.com/letter_avatar_proxy/v4/letter/s/f6c823/32.png) [@Sxcd1](https://www.phphelp.com/u/Sxcd1)\
**Post date:** [August 5, 2016, 11:14am UTC](https://www.phphelp.com/t/php-7-vs-5-6-in-ubuntu-14-04/25374/8 "2016-08-05T11:14:42Z")

</div>

localhost/info.php or 127.0.0.1/info.php  
nothing happens no error.

---

<div class="post-metadata">

**Author:** ![astonecipher](https://www.phphelp.com/user_avatar/www.phphelp.com/astonecipher/32/2797_2.png) [@astonecipher](https://www.phphelp.com/u/astonecipher)\
**Post date:** [August 5, 2016, 8:36pm UTC](https://www.phphelp.com/t/php-7-vs-5-6-in-ubuntu-14-04/25374/9 "2016-08-05T20:36:13Z")

</div>

Two different ways to do this…

This:  
[php]\<?php phpinfo(); [/php]

Should produce something similar to the info.PNG image.

Another route would be to run a file thru commandline. Same code in the file, but you would run it as

php /path/to/file/info.php

* * *

 ![info.PNG](https://www.phphelp.com/uploads/default/original/2X/b/b9642c4df83054cf2e028b0c7f64f68d56d7bc3c.PNG)

---

<div class="post-metadata">

**Author:** ![Sxcd1](https://www.phphelp.com/letter_avatar_proxy/v4/letter/s/f6c823/32.png) [@Sxcd1](https://www.phphelp.com/u/Sxcd1)\
**Post date:** [August 6, 2016, 3:01am UTC](https://www.phphelp.com/t/php-7-vs-5-6-in-ubuntu-14-04/25374/10 "2016-08-06T03:01:19Z")

</div>

When I run php info.php I get

```auto
XDG_SESSION_ID => 3
TERM => xterm
SHELL => /bin/bash
SSH_CLIENT => 192.168.1.9 53450 22
SSH_TTY => /dev/pts/0
USER => warren
LS_COLORS => rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
MAIL => /var/mail/warren
PATH => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
PWD => /var/www
LANG => en_US.UTF-8
SHLVL => 1
HOME => /home/warren
LOGNAME => warren
SSH_CONNECTION => 192.168.1.9 53450 192.168.1.20 22
LESSOPEN => | /usr/bin/lesspipe %s
XDG_RUNTIME_DIR => /run/user/1000
LESSCLOSE => /usr/bin/lesspipe %s %s
_ => /usr/bin/php
OLDPWD => /home/warren

PHP Variables

Variable => Value
_SERVER["XDG_SESSION_ID"] => 3
_SERVER["TERM"] => xterm
_SERVER["SHELL"] => /bin/bash
_SERVER["SSH_CLIENT"] => 192.168.1.9 53450 22
_SERVER["SSH_TTY"] => /dev/pts/0
_SERVER["USER"] => warren
_SERVER["LS_COLORS"] => rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
_SERVER["MAIL"] => /var/mail/warren
_SERVER["PATH"] => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
_SERVER["PWD"] => /var/www
_SERVER["LANG"] => en_US.UTF-8
_SERVER["SHLVL"] => 1
_SERVER["HOME"] => /home/warren
_SERVER["LOGNAME"] => warren
_SERVER["SSH_CONNECTION"] => 192.168.1.9 53450 192.168.1.20 22
_SERVER["LESSOPEN"] => | /usr/bin/lesspipe %s
_SERVER["XDG_RUNTIME_DIR"] => /run/user/1000
_SERVER["LESSCLOSE"] => /usr/bin/lesspipe %s %s
_SERVER["_"] => /usr/bin/php
_SERVER["OLDPWD"] => /home/warren
_SERVER["PHP_SELF"] => info.php
_SERVER["SCRIPT_NAME"] => info.php
_SERVER["SCRIPT_FILENAME"] => info.php
_SERVER["PATH_TRANSLATED"] => info.php
_SERVER["DOCUMENT_ROOT"] => 
_SERVER["REQUEST_TIME_FLOAT"] => 1470452136.571
_SERVER["REQUEST_TIME"] => 1470452136
_SERVER["argv"] => Array
(
    [0] => info.php
)

_SERVER["argc"] => 1

PHP License
This program is free software; you can redistribute it and/or modify
it under the terms of the PHP License as published by the PHP Group
and included in the distribution in the file: LICENSE

```

---

<div class="post-metadata">

**Author:** ![astonecipher](https://www.phphelp.com/user_avatar/www.phphelp.com/astonecipher/32/2797_2.png) [@astonecipher](https://www.phphelp.com/u/astonecipher)\
**Post date:** [August 6, 2016, 3:07am UTC](https://www.phphelp.com/t/php-7-vs-5-6-in-ubuntu-14-04/25374/11 "2016-08-06T03:07:10Z")

</div>

Yeah, things aren’t right.

Try installing php7 from here [https://github.com/kasparsd/php-7-debian](https://github.com/kasparsd/php-7-debian) do a git clone to grab it, then run the bash file.

---

<div class="post-metadata">

**Author:** ![Sxcd1](https://www.phphelp.com/letter_avatar_proxy/v4/letter/s/f6c823/32.png) [@Sxcd1](https://www.phphelp.com/u/Sxcd1)\
**Post date:** [August 6, 2016, 1:44pm UTC](https://www.phphelp.com/t/php-7-vs-5-6-in-ubuntu-14-04/25374/12 "2016-08-06T13:44:04Z")

</div>

I gete these errors on the last step

`sudo ./install.sh
mkdir: cannot create directory ‘/usr/local/php7/etc/conf.d’: No such file or directory
ln: failed to create symbolic link ‘/usr/local/php7/sbin/php7-fpm’: No such file or directory
cp: cannot stat ‘php-src/php.ini-production’: No such file or directory
cp: cannot create regular file ‘/usr/local/php7/etc/php-fpm.d/www.conf’: No such file or directory
cp: cannot create regular file ‘/usr/local/php7/etc/php-fpm.conf’: No such file or directory
cp: cannot create regular file ‘/usr/local/php7/etc/conf.d/modules.ini’: No such file or directory
 Adding system startup for /etc/init.d/php7-fpm ...
   /etc/rc0.d/K20php7-fpm -> ../init.d/php7-fpm
   /etc/rc1.d/K20php7-fpm -> ../init.d/php7-fpm
   /etc/rc6.d/K20php7-fpm -> ../init.d/php7-fpm
   /etc/rc2.d/S20php7-fpm -> ../init.d/php7-fpm
   /etc/rc3.d/S20php7-fpm -> ../init.d/php7-fpm
   /etc/rc4.d/S20php7-fpm -> ../init.d/php7-fpm
   /etc/rc5.d/S20php7-fpm -> ../init.d/php7-fpm
sed: can't read /usr/local/php7/etc/php-fpm.conf: No such file or directory`

It also says that the extension are not compatible with php 7 and I think I need them. Should I use php 5.6 instead?

---

<div class="post-metadata">

**Author:** ![astonecipher](https://www.phphelp.com/user_avatar/www.phphelp.com/astonecipher/32/2797_2.png) [@astonecipher](https://www.phphelp.com/u/astonecipher)\
**Post date:** [August 6, 2016, 5:08pm UTC](https://www.phphelp.com/t/php-7-vs-5-6-in-ubuntu-14-04/25374/13 "2016-08-06T17:08:46Z")

</div>

Okay. I Will look at their install script and what I have on my debian system, and may modify it to work
