0

I'm installing Magento for the first time, on a MAMP stack.

I've downloaded version 1.7 from the magento site (under RELEASE ARCHIVE).

I've unzipped it and pointed my Apache webserver root at the unzipped folder, but when I browse to http://localhost:8000 (for that is the port I am running it on), it redirects to http://localhost:8000/index.php/install/ which says "This page isn’t working" (HTTP ERROR 500).

In my PHP log it says :

[15-May-2017 03:43:46 UTC] PHP Fatal error: Uncaught Error: Function name must be a string in /installdir/magento1.7.0.2/app/code/core/Mage/Core/Model/Layout.php:555
Stack trace:
#0 /installdir/magento1.7.0.2/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#1 /installdir/magento1.7.0.2/app/code/core/Mage/Install/controllers/WizardController.php(120): Mage_Core_Controller_Varien_Action->renderLayout()
#2 /installdir/magento1.7.0.2/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Install_WizardController->beginAction()
#3 /installdir/magento1.7.0.2/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('begin')
#4 /installdir/magento1.7.0.2/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#5 /Users/newnrg/Projec in /installdir/magento1.7.0.2/app/code/core/Mage/Core/Model/Layout.php on line 555

(Note: I have tried $ chmod 777 var app media var/* app/* media/* var/.htaccess which I read about somewhere, but it made no difference for me)

Why is magento redirecting to /index.php/install/ out of the box?

And what do I do to fix it?

3

The file app/etc/local.xml is responsible for database connection in Magento. If this file is missing or misnamed, it is assumed that it is a new installation and prompts you through the installation routine.

Please check whether this file exists with correct name and permission.

Please let me know if problem still exists.

  • This is definitely a good first step - thank you. I've created an empty database now, and created a app/etc/local.xml file (based on this : markshust.com/2013/05/25/…, but with my credentials). Now the redirect does not happen, however I still get the HTTP ERROR 500 and the same errors in the PHP log. – kris May 15 '17 at 4:28
  • OK - and I've now resolved the other issue with the help of this article : atwix.com/magento/magento-and-php-7 : I'm running PHP 7 which Magento is apparently not quite compatible with. – kris May 15 '17 at 4:55
1

For PHP7 i recommend using https://github.com/Inchoo/Inchoo_PHP7, but i'm not sure if it also works with Magento 1.7.

(Is there a special reason why u use an old release - instead of 1.9.3.2?)

  • 1
    I'm creating an extension for Magento, and I want to create it for an earlier version first so that it is usable by as many existing installs as possible. – kris May 15 '17 at 23:19
  • Therefor i would suggest make it compatble backwards for Magento, but leave out PHP7 support ... Edit: please note older Magento version don't even support PHP5.x! – sv3n May 15 '17 at 23:46
  • you are absolutely right, and I won't code it for PHP7 - it's just that the MAMP environment I'm running doesn't currently have earlier versions of PHP -- however your point is excellent and I will see if I can get an earlier PHP installed so I don't accidentally use some newer PHP7 code forms. – kris May 15 '17 at 23:53
  • IMHO ... it doesnt make (big) sense to write (ultimate) PHP-backward compatible code ... most servers are at least on PHP5.4/5/6/7 so it's on you, where you want stop support. I've written alot of extensions for "our" company and as soon we switch over to PHP5.5+ i'll update code for it - but ATM i'll not rely on PHP7 :) – sv3n May 16 '17 at 0:07
  • I'm going with PHP 5.5 as my dev environment now. Switching to 5.4 threw an error in phpmyadmin on my MAMP stack. Thanks for your sharing your thoughts/wisdom about this. I actually haven't coded in PHP for many years before getting on to this project, and I'm not at all familiar with the differences between versions, so it's actually really important that I'm not working in version 7 if I want to create v 5 compatible code. (This is how I changed my MAMP PHP version : stackoverflow.com/a/16785309/1290746) – kris May 16 '17 at 0:26
1

As new version of PHP is released (Version 7 or Higher) it looks for "$callback" variable as function. So you need to change it in following path.

Steps to follow :

  1. Go to "app/code/core/Mage/Core/Model/Layout.php"
  2. Go to Line no. "555"
  3. Find the code :- "$out .= $this->getBlock($callback[0])->$callback[1]();"
  4. Replace it with :- "$out .= $this->getBlock($callback[0])->{$callback[1]}();"
  5. Save the file and try to install .

NOTE :- DO NOT MAKE DIRECT CHANGES , TRY TO OVERRIDE IN TO YOUR LOCAL MODULE

  • Downvoted cause there a lot of more things you've to adjust for PHP7 support. – sv3n May 16 '17 at 0:25

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.