{"id":458,"date":"2015-12-07T13:12:52","date_gmt":"2015-12-07T13:12:52","guid":{"rendered":"http:\/\/cloudkul.com\/blog\/?p=458"},"modified":"2017-06-14T11:34:28","modified_gmt":"2017-06-14T11:34:28","slug":"install-magento2-on-php7","status":"publish","type":"post","link":"https:\/\/cloudkul.com\/blog\/install-magento2-on-php7\/","title":{"rendered":"Install Magento 2 on PHP7"},"content":{"rendered":"<p>Magento 2 is the updated version of world&#8217;s famous e-commerce framework Magento, It has various benefits as compared to its predecessor like easier site maintenance, better scalability and improved conversions. The most important improvements in respect to business point of view are the streamlined checkout and the much- enhanced Admin Panel. In Magento 2 performance is improved by implementing separate database for order processing which results in reduced amounts of code, increased browser rendering , better image compression and static content caching.<\/p>\n<p>PHP7 is the updated version of PHP Scripting language. It introduced the zend Engine 3.0 which improve 2X performance and 50% better memory consumption than PHP 5.6 still its not officially released for production, so we suggest you to try this in your development environment not in the production environment.<\/p>\n<p><strong>Follow these steps to test Magento2 on PHP7.<\/strong><\/p>\n<p>Install LAMP stack on your server.<\/p>\n<pre class=\"lang:default decode:true \">sudo apt-get install lamp-server^<\/pre>\n<p>Build Dependencies for php5.<\/p>\n<pre class=\"lang:default decode:true\">sudo apt-get build-dep php5<\/pre>\n<p>Install missing packages required.<\/p>\n<pre class=\"lang:default decode:true\">sudo apt-get install build-essential libt1-dev bison libbz2-dev libjpeg62-dev libpng12-dev libfreetype6-dev libgmp3-dev libmcrypt-dev libmysqlclient-dev libpspell-dev librecode-dev apache2-dev git<\/pre>\n<p>Symlink the gmp.h file into \/usr\/include\/ so the makefile can find it.<\/p>\n<pre class=\"lang:default decode:true\">ln -s \/usr\/include\/x86_64-linux-gnu\/gmp.h \/usr\/include\/gmp.h<\/pre>\n<p>Install Mysql Server 5.6 Required for Magento 2<\/p>\n<pre class=\"lang:default decode:true\">sudo apt-get install mysql-server-5.6<\/pre>\n<p>Download the php7.0.0 source code.<\/p>\n<pre class=\"lang:default decode:true\">wget https:\/\/github.com\/php\/php-src\/archive\/PHP-7.0.0.zip\r\nunzip PHP-7.0.0.zip\r\nmv php-src-PHP-7.0.0 php7\r\n<\/pre>\n<p>Now run the builconf<\/p>\n<pre class=\"lang:default decode:true \">cd php7\/php-src\r\n.\/buildconf<\/pre>\n<p>Now we have to configure the php7 source code according to Magento 2 Requirements.<\/p>\n<pre class=\"lang:default decode:true\">.\/configure \\\r\n    --prefix=\/usr \\\r\n    --with-config-file-path=\/etc\/php7\/apache2 \\\r\n    --with-config-file-scan-dir=\/etc\/php7\/apache2\/conf.d \\\r\n    --enable-mbstring \\\r\n    --enable-zip \\\r\n    --enable-bcmath \\\r\n    --enable-pcntl \\\r\n    --enable-ftp \\\r\n    --enable-exif \\\r\n    --enable-calendar \\\r\n    --enable-sysvmsg \\\r\n    --enable-sysvsem \\\r\n    --enable-sysvshm \\\r\n    --enable-wddx \\\r\n    --with-curl \\\r\n    --with-mcrypt \\\r\n    --with-iconv \\\r\n    --with-gmp=\/usr\/include\/x86_64-linux-gnu \\\r\n    --with-pspell \\\r\n    --with-gd \\\r\n    --with-jpeg-dir=\/usr \\\r\n    --with-png-dir=\/usr \\\r\n    --with-zlib-dir=\/usr \\\r\n    --with-xpm-dir=\/usr \\\r\n    --with-freetype-dir=\/usr \\\r\n    --enable-gd-native-ttf \\\r\n    --enable-gd-jis-conv \\\r\n    --with-openssl \\\r\n    --with-pdo-mysql=\/usr \\\r\n    --with-gettext=\/usr \\\r\n    --with-zlib=\/usr \\\r\n    --with-bz2=\/bin \\\r\n    --with-recode=\/usr \\\r\n    --with-mysqli=\/usr\/bin\/mysql_config \\\r\n    --with-apxs2 \\\r\n    --with-xsl \\\r\n    --enable-intl \\\r\n    --enable-dtrace<\/pre>\n<p>After configuring and testing the source code lets build the code .<\/p>\n<pre class=\"lang:default decode:true \">make\r\nmake test\r\nmake install<\/pre>\n<p>Now force php to use new php, even replace the php5 binary with new php.<\/p>\n<pre class=\"lang:default decode:true \">cd \/usr\/bin\r\nmv php5 php5.orig\r\nmv phpize5 phpize5.orig\r\nmv php-config5 php-config5.orig\r\nln -s php php5\r\nln -s phpize phpize5\r\nln -s php-config php-config5<\/pre>\n<p>We need a php7.conf file into our apache mods, its better to replace the php5.conf file.<\/p>\n<pre class=\"lang:default decode:true \">cp \/etc\/apache2\/mods-enabled\/php5.conf \/etc\/apache2\/mods-enabled\/php7.conf<\/pre>\n<p>Disable php5 in apache, we can&#8217;t have php5 and php7 enabled after that restart the apache<\/p>\n<pre class=\"lang:default decode:true \">a2dismod php5\r\n\/etc\/init.d\/apache2 restart\r\n<\/pre>\n<p>Create a symlink by creating directory \/etc\/php7 with respect to \/etc\/php5<\/p>\n<pre class=\"lang:default decode:true \">cd \/etc\/ &amp;&amp; ln -s php5 php7<\/pre>\n<p>Now check the php version.<\/p>\n<pre class=\"lang:default decode:true \">php -v<\/pre>\n<p>After this create a file phpinfo.php into the document root directory of apache and copy the following content into that file to check the version of php integrated with apache.<\/p>\n<pre class=\"lang:php decode:true\">&lt;?php\r\n\r\nphpinfo();\r\n\r\n?&gt;<\/pre>\n<pre class=\"lang:default decode:true \">Note-: If you get the php version 7 in both version checks congratulations you are ready to install Magento 2 on php7.<\/pre>\n<p>Now <a href=\"https:\/\/www.magentocommerce.com\/download\" target=\"_blank\">Download Magento 2<\/a> and unzip the content into Apache document root directory \/var\/www\/html\/<\/p>\n<p>Change the ownership of \/var\/www\/html directory from root to www-data by following command<\/p>\n<pre class=\"lang:default decode:true \">chown -R www-data:www-data \/var\/www\/html\/<\/pre>\n<p>change AllowOverride None to AllowOverride All in apache2.conf for Apache Document root directory.<\/p>\n<pre class=\"lang:apache decode:true\">&lt;Directory \/var\/www\/html&gt;\r\n        Options Indexes FollowSymLinks\r\n        AllowOverride All\r\n        Require all granted\r\n&lt;\/Directory&gt;<\/pre>\n<p>Now enable the rewrite module by following command.<\/p>\n<pre class=\"lang:default decode:true \">a2enmod rewrite<\/pre>\n<p>Now hit the URL or IP of that Apache Server on your browser and follow the Instructions to successfully install Magento2.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/cloudkul.com\/contact\/\" target=\"_blank\">FOR ANY TYPE OF QUERY OR HELP, PLEASE CONTACT US<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Magento 2 is the updated version of world&#8217;s famous e-commerce framework Magento, It has various <a class=\"text-primary\" title=\"read more\" href=\"https:\/\/cloudkul.com\/blog\/install-magento2-on-php7\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":6,"featured_media":483,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[20,21],"tags":[24,22,23],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Install Magento 2 on PHP7 - Cloudkul<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudkul.com\/blog\/install-magento2-on-php7\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Install Magento 2 on PHP7 - Cloudkul\" \/>\n<meta property=\"og:description\" content=\"Magento 2 is the updated version of world&#8217;s famous e-commerce framework Magento, It has various [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudkul.com\/blog\/install-magento2-on-php7\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudkul\" \/>\n<meta property=\"article:published_time\" content=\"2015-12-07T13:12:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-06-14T11:34:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2015\/12\/Magento2-Installation-on-PHP7-3.png\" \/>\n\t<meta property=\"og:image:width\" content=\"848\" \/>\n\t<meta property=\"og:image:height\" content=\"422\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Nitin Agnihotri\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudkul.com\/blog\/install-magento2-on-php7\/\",\"url\":\"https:\/\/cloudkul.com\/blog\/install-magento2-on-php7\/\",\"name\":\"Install Magento 2 on PHP7 - Cloudkul\",\"isPartOf\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\"},\"datePublished\":\"2015-12-07T13:12:52+00:00\",\"dateModified\":\"2017-06-14T11:34:28+00:00\",\"author\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/2891deba97a03939d99419a3ac3407a4\"},\"breadcrumb\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/install-magento2-on-php7\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudkul.com\/blog\/install-magento2-on-php7\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudkul.com\/blog\/install-magento2-on-php7\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Install Magento 2 on PHP7\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\",\"url\":\"https:\/\/cloudkul.com\/blog\/\",\"name\":\"Cloudkul\",\"description\":\"Host your eCommerce Store on AWS with Optimized Performance\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudkul.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/2891deba97a03939d99419a3ac3407a4\",\"name\":\"Nitin Agnihotri\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/78eef67ca93349ba049e7db9e3481aa9?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/78eef67ca93349ba049e7db9e3481aa9?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"caption\":\"Nitin Agnihotri\"},\"url\":\"https:\/\/cloudkul.com\/blog\/author\/nitin124\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Install Magento 2 on PHP7 - Cloudkul","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudkul.com\/blog\/install-magento2-on-php7\/","og_locale":"en_US","og_type":"article","og_title":"Install Magento 2 on PHP7 - Cloudkul","og_description":"Magento 2 is the updated version of world&#8217;s famous e-commerce framework Magento, It has various [...]","og_url":"https:\/\/cloudkul.com\/blog\/install-magento2-on-php7\/","og_site_name":"Cloudkul","article_published_time":"2015-12-07T13:12:52+00:00","article_modified_time":"2017-06-14T11:34:28+00:00","og_image":[{"width":848,"height":422,"url":"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2015\/12\/Magento2-Installation-on-PHP7-3.png","type":"image\/png"}],"author":"Nitin Agnihotri","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/cloudkul.com\/blog\/install-magento2-on-php7\/","url":"https:\/\/cloudkul.com\/blog\/install-magento2-on-php7\/","name":"Install Magento 2 on PHP7 - Cloudkul","isPartOf":{"@id":"https:\/\/cloudkul.com\/blog\/#website"},"datePublished":"2015-12-07T13:12:52+00:00","dateModified":"2017-06-14T11:34:28+00:00","author":{"@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/2891deba97a03939d99419a3ac3407a4"},"breadcrumb":{"@id":"https:\/\/cloudkul.com\/blog\/install-magento2-on-php7\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudkul.com\/blog\/install-magento2-on-php7\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cloudkul.com\/blog\/install-magento2-on-php7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Install Magento 2 on PHP7"}]},{"@type":"WebSite","@id":"https:\/\/cloudkul.com\/blog\/#website","url":"https:\/\/cloudkul.com\/blog\/","name":"Cloudkul","description":"Host your eCommerce Store on AWS with Optimized Performance","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudkul.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/2891deba97a03939d99419a3ac3407a4","name":"Nitin Agnihotri","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/78eef67ca93349ba049e7db9e3481aa9?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/78eef67ca93349ba049e7db9e3481aa9?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","caption":"Nitin Agnihotri"},"url":"https:\/\/cloudkul.com\/blog\/author\/nitin124\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/458"}],"collection":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/comments?post=458"}],"version-history":[{"count":20,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/458\/revisions"}],"predecessor-version":[{"id":503,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/458\/revisions\/503"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media\/483"}],"wp:attachment":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media?parent=458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/categories?post=458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/tags?post=458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}