Running Magento 1.9.x with PHP 7


#1

Hi,

I have a bit of an issue with a migrated, inherited Magento site (currently 1.9.2.4). The site needs quite a lot of patches applying and using ssh just causes a lot of hunk errors.

I was thinking I would just clone the site, run all the updates via Magento connect and see what happens. However, Cloudways will not facilitate a clone as the site is using php 5.6. So that is out of the question.

I’m just wondering if anyone is running a Magento 1.9 site on php 7, what problems if any did you run into?

Alternatively, should I just make a backup of the site, and run the Magento connect in any case, is it pretty reliable?


#2

There’s no harm in running Magento 1.x on PHP 7. Just clone it, update all the extensions and Magento core itself and you’re good to go.

If you have an older version of Magento 1.x, try the following solution:


#3

Hi,

Thanks for the reply, so could I clone this to a new server, update everything, test, make sure it works. And then bin that server once I’m satisfied everything works.

I just don’t wish to implement something, and then the clients site is un-usable.

I realise there will be a cost to this method.


#4

Hi,

So here is what I did.

  1. I cloned the current server to a new one
  2. Logged in
  3. Updated Mage_All_Latest via Magento connect to 1.9.3.8

I am then faced with the below errors?

Am I please I clone the server, you bet I am!

There has been an error processing your request Error in file: "/home/181476.cloudwaysapps.com/eczrxwbjsq/public_html/app/code/core/Mage/Customer/sql/ustomer_setup/upgrade-1.6.2.0.4-1.6.2.0.5.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'customer_flowpassword' already exists, query was: CREATE TABLE `customer_flowpassword` (`flowpassword_id` int UNSIGNED NOT NULL auto_increment COMMENT 'Flow password Id' , `ip` varchar(50) NOT NULL COMMENT 'User IP' , `email` varchar(255) NOT NULL COMMENT 'Requested email for change' , `requested_date` varchar(255) NOT NULL default '0000-00-00 00:00:00' COMMENT 'Requested date for change' , PRIMARY KEY (`flowpassword_id`), INDEX `IDX_CUSTOMER_FLOWPASSWORD_EMAIL` (`email`), INDEX `IDX_CUSTOMER_FLOWPASSWORD_IP` (`ip`), INDEX `IDX_CUSTOMER_FLOWPASSWORD_REQUESTED_DATE` (`requested_date`)) COMMENT='Customer flow password' ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci

Trace:
#0 /home/181476.cloudwaysapps.com/eczrxwbjsq/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(644): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /home/181476.cloudwaysapps.com/eczrxwbjsq/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(437): Mage_Core_Model_Resource_Setup->_modifyResourceDb('upgrade', '1.6.2.0.4', '1.6.2.0.6')
#2 /home/181476.cloudwaysapps.com/eczrxwbjsq/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(320): Mage_Core_Model_Resource_Setup->_upgradeResourceDb('1.6.2.0.4', '1.6.2.0.6')
#3 /home/181476.cloudwaysapps.com/eczrxwbjsq/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /home/181476.cloudwaysapps.com/eczrxwbjsq/public_html/app/code/core/Mage/Core/Model/App.php(428): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /home/181476.cloudwaysapps.com/eczrxwbjsq/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Model_App->_initModules()
#6 /home/181476.cloudwaysapps.com/eczrxwbjsq/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#7 /home/181476.cloudwaysapps.com/eczrxwbjsq/public_html/index.php(83): Mage::run('', 'store')
#8 {main}

So this is before I even attempted php 7.

Any advise please?


#5

Magento executes upgrade scripts, but only marks them done when they complete without error. Even an incompletely run script can have created tables, though, and next time Magento tries to run that update script the existence of those tables cause a problem.

The error message is telling you that Magento tries to create a table ‘customer_flowpassword’ which already exists. This takes place in an upgrade script (/home/181476.cloudwaysapps.com/eczrxwbjsq/public_html/app/code/core/Mage/Customer/sql/ustomer_setup/upgrade-1.6.2.0.4-1.6.2.0.5.php) and was probably caused by a previous incomplete run of the said upgrade script.

So you can either do some Database work and do some tweaking like removing the tables in question (with saving the data if needed) or redo your Magento Installation.

This can also be caused by recently installed extensions if so uninstalling them with the Connect Manager and reinstalling them might work.