Skip to content

Latest commit

 

History

History
154 lines (102 loc) · 6.69 KB

php-ubuntu.md

File metadata and controls

154 lines (102 loc) · 6.69 KB
group subgroup title menu_title menu_order level3_menu_node level3_subgroup functional_areas
installation-guide
Prerequisites
PHP 5.5, 5.6, or 7.0—Ubuntu
PHP 5.5, 5.6, or 7.0—Ubuntu
23
level3child
php
Install
System
Setup

{: .bs-callout .bs-callout-info } If you must install both Apache and PHP, [install Apache]({{ page.baseurl }}/install-gde/prereq/apache.html) first.

PHP versions supported {#php-support}

Magento requires:

{% include install/php_2.0.md %}

{: .bs-callout .bs-callout-info } Magento no longer supports {% glossarytooltip bf703ab1-ca4b-48f9-b2b7-16a81fd46e02 %}PHP{% endglossarytooltip %} 5.4.

Help if you're just starting out {#php-ubuntu-help-beginner}

If you're new to all this and need some help getting started, we suggest the following:

Verify PHP is installed {#ubuntu-verify-php}

To verify if PHP is installed already, enter php -v. If PHP is installed, messages similar to the following display:

PHP 5.6.4-1+deb.sury.org~precise+1 (cli) (built: Dec 21 2014 19:26:25)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

{: .bs-callout .bs-callout-info } The preceding message confirms that the Zend OPcache is installed. We strongly recommend using the OPcache for performance reasons. If your PHP distribution does not come with the OPcache, see the PHP OPcache documentation{: target="_blank"}.

If PHP is installed, continue with the next prerequisite, MySQL.

If PHP is not installed, see one of the following sections:

PHP 7.0 on Ubuntu 14 or 16 {#instgde-prereq-php70-ubuntu}

{% collapsible To install PHP 7 on Ubuntu 14: %}

  1. Enter the following commands in the order shown:

    sudo apt-get -y update
    sudo add-apt-repository ppa:ondrej/php
    sudo apt-get -y update
    sudo apt-get install -y php7.0 libapache2-mod-php7.0 php7.0 php7.0-common php7.0-gd php7.0-mysql php7.0-mcrypt php7.0-curl php7.0-intl php7.0-xsl php7.0-mbstring php7.0-zip php7.0-bcmath php7.0-iconv php7.0-soap
    
    The `bcmath` extension is required for {{site.data.var.ee}} only.
  2. Enter the following command to verify PHP 7 installed properly:

    php -v
    

    Following is a sample response that indicates PHP 7.0.8 is installed:

    PHP 7.0.8-2+deb.sury.org~trusty+1 (cli) ( NTS )
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
      with Zend OPcache v7.0.8-2+deb.sury.org~trusty+1, Copyright (c) 1999-2016, by Zend Technologies
    
    The preceding message confirms that the `Zend OPcache` is installed. We strongly recommend using the OPcache for performance reasons. If your PHP distribution does not come with the OPcache, see the [PHP OPcache documentation](http://php.net/manual/en/opcache.setup.php){: target="_blank"}.
  3. Continue with [Required PHP settings]({{ page.baseurl }}/install-gde/prereq/php-settings.html).

{% endcollapsible %}

PHP 5.6 on Ubuntu 14

{% collapsible To install PHP 5.6 or to upgrade from PHP 5.5 on Ubuntu 14: %}

  1. Enter the following commands in the order shown:

    apt-get -y update
    add-apt-repository ppa:ondrej/php
    apt-get -y update
    apt-get -y install php5.6 php5.6-mcrypt php5.6-mbstring php5.6-curl php5.6-cli php5.6-mysql php5.6-gd php5.6-intl php5.6-xsl php5.6-zip php5.6-soap
    
  2. Enter the following command to verify PHP 5.6 installed properly:

    php -v
    

    Following is a sample response that indicates PHP 5.6 is installed:

    PHP 5.6.22-4+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
    
    The preceding message confirms that the `Zend OPcache` is installed. We strongly recommend using the OPcache for performance reasons. If your PHP distribution does not come with the OPcache, see the [PHP OPcache documentation](http://php.net/manual/en/opcache.setup.php){: target="_blank"}.
  3. Continue with [Required PHP settings]({{ page.baseurl }}/install-gde/prereq/php-settings.html).

{% endcollapsible %}

PHP 5.5 on Ubuntu 14

{% collapsible To install PHP 5.5 on Ubuntu 14: %}

  1. Enter the following commands in the order shown:

    apt-get -y update
    apt-get -y install php5 php5-mcrypt php5-curl php5-cli php5-mysql php5-gd php5-intl php5-xsl php5-soap
    
  2. Verify the PHP version by entering php -v. Messages similar to the following should display:

    PHP 5.5.9-1ubuntu4.4 (cli) (built: Sep  4 2014 06:56:34)
    Copyright (c) 1997-2014 The PHP Group
    Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
    
    The preceding message confirms that the `Zend OPcache` is installed. We strongly recommend using the OPcache for performance reasons. If your PHP distribution does not come with the OPcache, see the [PHP OPcache documentation](http://php.net/manual/en/opcache.setup.php){: target="_blank"}.
  3. Continue with [Required PHP settings]({{ page.baseurl }}/install-gde/prereq/php-settings.html).

{% endcollapsible %}

Related topics