Top Nav

Archive | Magento

Magento 2 – Add Admin From Command Line

To add an admin user to a Magento 2 site from the command line, SSH to the server and change to the root directory of the Magento 2 install. Then run this command:

On a server with Plesk a few notes:

  • It’s best to run this command as the user that owns the website subscription.
  • You may need to set the path to the correct PHP version with “export PATH=/opt/plesk/php/7.0/bin/php:$PATH”.
  • If you get “PHP Fatal error: Allowed memory size of xxxxxxx bytes exhausted” then edit the php.ini file for the correct PHP version and increase the “memory_limit” setting.



Magento SUPEE-7405 Parse Error

Applying the new SUPEE-7405 patch to Magento (and probably other versions) results in a parse error in the sales order view page (admin/sales_order/view/order_id) if the site is running under PHP5.3. Here’s the error message:

The offending line is:

it can be changed to:

PHP 5.3 does not support the “[]” syntax for array initialization. Of course you should not be running PHP 5.3!


Changing Magento Path

Suppose you have a Magento Commerce store at:

but you want to change the URL to:

There are plenty of articles that give the basics like:

Basically the steps are:

1. Login to admin, go to Configuration -> Web and change the secure and insecure urls.

2. Move the store/ folder to catalog/

3. Clear cache and sessions folders with

4. Add a rewrite rule in your .htaccess to send traffic from the old path to the new path:

So far so good but we found several additional steps that might be needed. If compilation is turned on then you may need to do:

Next if you have APC installed in PHP then you may need to restart the web server to clear the APC cache with something like:

If you have memcached configured as the cache backend then you’ll also need to restart memcached:

Let us know if the comments if you find any other steps that are needed to successfully move magento to a new path.




Magento – List Applied Patches

You can view a list of patches that have been applied to a Magento site with:

You’ll get something like this:



Howto Determine Magento Version

Previously we posted an article on how to determine Magento version by checking the app/Mage.php file:

Determine Magento Commerce Version

Here’s another technique that I like using PHP command line:

Credit for this goes to