PHP 5.3 syntax error, unexpected [
mbautista opened this issue ยท 7 comments
Hello,
I would like to upgrade a very old web server :
A- Linux Debian 7 -> 9
B- PHP 5.3 -> 7.0
C- Magento 1.3 -> 1.9
I thought to upgrade in the following order :
C (upgrade Magento first)
A+B (then upgrade Debian and PHP at the same time, as PHP 7.0 is the default for Debian 9)
I hoped to upgrade Magento 1.3 to 1.9 using n98-magerun because the Magento upgrade does not work anymore due to 404 errors : https://astrio.net/blog/magento-upgrade-guide/
Unfortunately when I run n98-magerun with php 5.3 I have the following error :
./n98-magerun.phar
PHP Parse error: syntax error, unexpected '[' in phar:///home/mywebsite/n98-magerun.phar/vendor/psy/psysh/src/functions.php on line 78
On the opposite when I run ./n98-magerun.phar with PHP 7.0 on my old Magento 1.3 website I have the following errors :
./n98-magerun.phar upgrade
[InvalidArgumentException]
Composer could not find the config file: /home/mywebsite/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Could anyone tell me what is the correct approach to upgrade this old server ?
Thank you very much :)
Mathieu.
@mbautista unfortunately php 5.3 support has been dropped.
The upgrade steps listed in the blog post should still work, upgraded some sites not too long ago.
Be sure to try the step listed on the post. (it can take a while but should complete)
./mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force
Hello will,
Thank you for your answer, but when I follow the upgrade blog I have this error :
Discovering channel connect.magentocommerce.com/community over http:// failed with message: channel-add: Cannot open "http://connect.magentocommerce.com/community/channel.xml" (File http://connect.magentocommerce.com:80/community/channel.xml not valid (received: HTTP/1.1 404 Not Found
))
Trying to discover channel connect.magentocommerce.com/community over https:// instead
Discovery of channel "connect.magentocommerce.com/community" failed (channel-add: Cannot open "https://connect.magentocommerce.com/community/channel.xml" (Connection to `connect.magentocommerce.com:443' failed: ))
I'm afraid the https://connect.magentocommerce.com/community/channel.xml
does not exist anymore which make the upgrade impossible.
Maybe I could proxy this file if I could get it from somewhere else ?
Mathieu.
@mbautista is that a n98-magerun issue? The old Magento pear channel was stopped. You should change your upgrade procedure.
Hello cmuench,
The official way of upgrade is broken so I was searching for an alternative way using n98-magerun, but maybe it's not possible ? (just asking).
I understand that n98-magerun dropped PHP 5.3, but do you know if there is an old version of n98-magerun I could use for this ?
If that's not the way to go then I'll try to upgrade manually (copy magento 1.9 files and then upgrade database).
Thank you for your answers :)
@mbautista We dropped support for PHP <5.4 in v1.103.0.
You can find and download old versions here: https://files.magerun.net/old_versions.php
v1.102.0 should work with your PHP version.
Problem solved (as far as n98-magerun is concerned ;))
Thank you very much :)
@mbautista We dropped support for PHP <5.4 in v1.103.0.
You can find and download old versions here: https://files.magerun.net/old_versions.phpv1.102.0 should work with your PHP version.
This is working on my end. Thanks @cmuench