0

I am trying to use Magento locally on Windows with PHP 7.

I have followed this guide.

***** Step By Step *****

  • Download the latest Apache Version - Zip-File
  • Copy Apache24 folder from Zip-File to your C: Drive
  • Navigate into C:/Apache24/bin
  • Open file --httpd-- with Rightclick -- Run as Administrator .
  • Open Start-menu -- Type in : cmd -- Right Click -- Run as Administrator
  • Type in CMD ---- cd /Apache24/bin --
  • Type in -- httpd -k install -- leave CMD open
  • Download !!THREAD SAFE!! Version of PHP
  • Open PHP Zip-File
  • Create folder --PHP-- in the C: Drive
  • Copy Content of PHP Zip-File to C:/PHP/
  • Go to C:/PHP
  • Search for File with name: "php7apache2_2.dll" and copy the name !! File has other name if older PHP version was downloaded !!
  • Go to C:/Apache24/conf
  • Open File "httpd" with Editor
  • Scroll to bottom and add the following Code: " LoadModule php7_module "C:/PHP/php7apache2_4" AddHandler application/x-httpd-php .php PHPIniDir C:/PHP " !! Change PHP Version 7 to the one that you have chosen !!
  • Search for line " DirectoryIndex index.html " Change to: "DirectoryIndex index.php index.html"
  • Save and close
  • Go back to CMD and type in " httpd -k restart "
  • Download MySQL
  • Install MySQL with downloaded installer "Developer Default"
  • During Installation choose ROOT Password and save it for later use
  • Download phpMyAdmin
  • Copy Folder in Zip File into C:/Apache24/htdocs
  • Rename copied folder into "phpmyadmin"
  • Navigate to C:/PHP
  • Rename File "php.ini-production" to "php.ini"
  • Open php.ini with Editor
  • Search for Line "extension=php_mbstring.dll"
  • Remove Semicolon ";" in front of "extension=php_mbstring.dll" and "extension=php_mysqli.dll"
  • Save Exit
  • Open CMD and Type in " httpd -k restart "
  • FINISHED!

However Magento is not compatible with PHP 7.

So i guess I need to use a different PHP version, so I tried PHP 5.4 but got stuck. I think i need to change:

" LoadModule php7_module "C:/PHP/php7apache2_4"

But cannot find the equivelent to C:/PHP/php7apache2_4.

1

Inchoo php7 is for magento 1.

As I understand from your question title you have magento 2.1.5 and it works with php 7 out of the box. You don't have to do anything.

Although it might not support minor versions of php 7 (like php7.0.0) - for that you would have to consult the official white paper http://devdocs.magento.com/guides/v2.1/install-gde/system-requirements-tech.html

UPDATE:

It might be that M2 installation file doesn't recognize your php version.

Disclaimer: this is a hack. Do not use it in production.

To temporarily fix that and have your M2 store installed you can try this hack:

Open up setup/src/Magento/Setup/Model/PhpRedinessCheck.php and change line 79

from:

$normalizedPhpVersion = $this->getNormalizedCurrentPhpVersion(PHP_VERSION);

to:

$normalizedPhpVersion = $this->getNormalizedCurrentPhpVersion('7.0.2');

then proceed with installation.

you fooled magento into thinking your php is 7.0.2

I did that to install M2 on php 7.1 - https://www.goivvy.com/blog/solved-magento-213-php-710

  • When running magento readiness check there is a red X next to PHP version check and PHP extensions check – james Mar 19 '17 at 19:48
  • You are right. I misread the question. I'll remove my answer – nuovecode Mar 19 '17 at 19:48
  • what is your php version exactly? – Konstantin Gerasimov Mar 19 '17 at 19:50
  • php-7.0.17-Win32-VC14-x64 – james Mar 19 '17 at 19:51
  • see my updated answer. – Konstantin Gerasimov Mar 19 '17 at 19:56
0

However Magento is not compatible with PHP 7.

So i guess I need to use a different PHP version, so I tried PHP 5.4 but got stuck. I think i need to change:

You make the wrong assumption here. Magento 2.1 does not work with PHP 5.4, Magento 2.2 will not even work with PHP 5.6 anymore, so you really should use PHP 7. But it has to be PHP 7.0, because Magento 2.1 is not yet compatible with PHP 7.1.

To help you with your installation, you should explain what the problem was that lead to your conclusion that Magento does not work with PHP 7.

By the way, running Magento 2 on Windows is possible in theory but it has some pitfalls, like:

  • Magento must have permissions to create symlinks in developer mode
  • It can easily happen that the maximum NTFS path length of 255 is reached
  • When running magento readiness check there is a red X next to PHP version check and PHP extensions check – james Mar 19 '17 at 19:54
  • Then you are probably lacking php extensions. The check should tell you which ones. Uncomment the respective lines in php.ini – Fabian Schmengler Mar 19 '17 at 19:56
  • PHP Version Check Your PHP version is . The required PHP version is . Hide detail Download and install PHP from www.php.net using this PHP Documentation. For additional assistance, contact your hosting provider. – james Mar 19 '17 at 20:08
  • PHP Extensions Check missing PHP extensions. Hide detail The best way to resolve this is to install the correct missing extensions. The exact fix depends on our server, your host, and other system variables. Our PHP extension help can get you started. – james Mar 19 '17 at 20:08
  • No mention of version or what extensions – james Mar 19 '17 at 20:09

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.