Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How To Get Magento Connect To Work - (For the Technically Challenged!!)
 
Stuarts
Member
 
Total Posts:  66
Joined:  2009-03-16
 

Hi Guys,

I have only just downloaded Magento starting at Version 1.2.1.2 - Looks nice. But I immediately ran into the problem that Magento Connect would not work.

It would keep returning errors about file permissions.

ie

Error: Please check for sufficient write file permissions

Your Magento folder does not have sufficient write permissions, which this web based downloader requires.

If you wish to proceed downloading Magento packages online, please set all Magento folders to have writable permission for the web server user (example: apache) and press the “Refresh” button to try again.

After looking around on here, I pieced together that you needed to change the file permissions to get this to work. But that this had to be done via SSH, and not FTP.

I discovered this for myself. Because I changed all the file permissions to 777 on ftp, but still got the error.

Anyhow, I have just figured out how to do this with SSH, and its really quite easy. However, for the technically challenged I have set out a step by step process of EXACTLY what you need to do. As frankly, this would have saved me a lot of time figuring it all out if it had been here to begin with, and someone else will undoubtedly benefit from the knowledge.

I am definitely not claiming to be an expert on this stuff, so don’t ask me questions. This is simply what I did. Its not rocket science though, and I do think that these things are often made to seem harder then they really are (hence the post)

Here you go.

Exactly how to SSH into a server and change the file permissions to get Magento Connect working:

How To Login Using SSH and Change File Permissions


1/ Go to: http://www.chiark.greenend.org.uk/~sgtatham/putty/ - And download Putty to your desktop.

(At the time of asking the download link is:)

http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe

2/ Open the PuTTY client (usually putty.exe). You will now see the “PuTTY Configuration” window.

3/ On the left side, you will see a tree structure called “Category:”. There are four categories: Session, Terminal, Window, and Connection. Expand the “Connection” category and select “SSH”.

4/ On the right side, look in the middle:
for “Preferred SSH protocol version:”. Select version “2”.

5/ On the left side in the category tree structure, go back to “Session”.

6/ On the right side, look for the “Host Name (or IP Address)” input box at the top. Enter your server’s main IP address only.

eg 66.12.12.15 - Whatever. Ask your host if you don’t know what it is. Odds are that it will appear somewhere on you welcome email from them, or else if you have cpanel then you will be able to see it on their.

7/ Click ‘Open’ and a window appears.

8/ Click on the little empty green box with your left mouse. It will then fill with green and you will be able to type (This applies all the time)

9/ Login as: (Put in the username you would login as on your server)

10/ Then root@66.12.12.15 Password: (ie the 66.12.12.15 will be whatever IP address you put in) - Put in the password for your server here

11/ Ok. You are now logged into the ‘root’ of your server. That means the very bottom layer. So you will want to change directories in order to run some commands to change file permissions:

So…

12/ In my server I had to type cd /home/mysite/public_html

Note - My magento install was setup in the root of the domain.


If I had set it up in a folder called ‘magento’ (as lots of folk seem to here) then I would have instead typed:

cd /home/mysite/public_html/magento

Tip: If you haven’t got a scoobies what to put here then you can do two things to find out.

- Type the command ‘ls’ at the prompt will list the folders. So you can see what is available.

- Try ftping into your site. If you look at the box at the top it shows you what you need to type ie just go into the folder whose permissions you want to change in ftp and copy the url bar

13/ Now comes the ‘magic’ that will get Magento Connect working grin

Copy the following line: (Code courtesy of a Crucial post)

find . -type d -exec chmod 777 {} \;
--------------------------------------

Once putty (ssh) is in the right folder above (ie wherever you installed it - only you know this - and incidentally, you do this at your own risk. I am simply letting you know what worked for me. Changing directories to 777 actually strikes me as a really dumb thing to do, but it appears at the time of writing to be the only way to get Magento Connect to work (Magento Dudes - you really need to change this)

My prompt line looked like this to give you some idea:

root@host (/home/mysite/public_html)~ (Green Prompt)

-----------------------------------------

Right click on the green prompt. This will paste it in. Press enter.

Now copy this line.

find . -type f -exec chmod 644 {} \;

Right click on the green prompt. This will paste it in. Press enter



Ok. So what you will have done in essence is changed the files to 644 and all the directories to 777.

After this if you go to:

http://www.yoursite.com/downloader (assuming you set up magento in the root)

or:

http://www.yoursite.com/magento/downloader (if it was setup in a folder called magento)

Then MagentoConnect will now work and you will be able to login as admin.


Happy Downloading!!

Optional… In next post

 
Magento Community Magento Community
Magento Community
Magento Community
 
Stuarts
Member
 
Total Posts:  66
Joined:  2009-03-16
 

[b]14/ Once you have downloaded all the required programs from Magento Connect

then it is a good idea to reset your file permissions so that your server

isn’t compromised (ie By the directories being set to 777)

To do that, run the following in the same place (file wise) as for the

above instructions:

http://www.magentocommerce.com/wiki/groups/227/resetting_file_permissions

Here’s how to reset your file and directory permissions:

1. find . -type f -exec chmod 644 {} \;
2. find . -type d -exec chmod 755 {} \;
3. chmod o+w var var/.htaccess app/etc
4. chmod 550 pear
5. chmod -R o+w media

The above commands need to be executed from the root directory where

Magento is installed.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Crucial
Enthusiast
 
Avatar
Total Posts:  770
Joined:  2007-11-07
Phoenix, AZ
 
Stuarts - 19 March 2009 07:15 AM

2/ Open the PuTTY client (usually putty.exe). You will now see the “PuTTY Configuration” window.

3/ On the left side, you will see a tree structure called “Category:”. There are four categories: Session, Terminal, Window, and Connection. Expand the “Connection” category and select “SSH”.

4/ On the right side, look in the middle:

for “Preferred SSH protocol version:”. Select version “2”.

5/ On the left side in the category tree structure, go back to “Session”.

6/ On the right side, look for the “Host Name (or IP Address)” input box at the top. Enter your server’s main IP address only.

eg 66.12.12.15 - Whatever. Ask your host if you don’t know what it is. Odds are that it will appear somewhere on you welcome email from them, or else if you have cpanel then you will be able to see it on their.

7/ Click ‘Open’ and a window appears.

You can actually just enter the hostname and click the Open button, as SSH is the default protocol.

8/ Click on the little empty green box with your left mouse. It will then fill with green and you will be able to type (This applies all the time)

There’s no need to click on the green box, just make sure the SSH window is active (not minimized) and you can start typing.

----------

While this was a great guide for beginners on using SSH, my question is:

If you have access to SSH, it does not make sense to set the permissions like this just to use the web-based Magento Connect. You’re in SSH already, so use that instead.

On your server (or anyone who gets this error) you have PHP running as an Apache module (DSO). So processes spawned from the browser are ran by user nobody. So any files that Magento Connect downloads or updates will also be owned by user nobody.

This is why you have to set directories to 777, because this user does not have permission to mess with files with default 644 permissions (or directories with default 775 permissions). They aren’t owned by nobody, so they have to have full read/write permissions (bad).

When you’re in SSH, you’re logged in as the appropriate user for your site, so this user doesn’t need special permissions to do things.

Just use SSH to install extensions or upgrade Magento:

http://www.magentocommerce.com/wiki/groups/227/installing_extensions_via_ssh

http://www.magentocommerce.com/wiki/groups/227/upgrading_magento_via_ssh

Now you don’t have to worry about setting your file permissions insecurely, and can take advantage of SSH to quickly get things done.

Also, for users who DO have root access to the server, avoid using this user to do things. You mentioned you have cPanel installed, so SSH in as this user, not root, otherwise, any process YOU initiate as root will then make any files/directories that are created now owned by user root, and not the user for that account.

 
Magento Community Magento Community
Magento Community
Magento Community
 
zvezda
Jr. Member
 
Total Posts:  14
Joined:  2007-09-20
 

what about if you don’t have shell access??? how to use magento connect than??

thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
skippybosco
Enthusiast
 
Avatar
Total Posts:  796
Joined:  2008-10-03
 

@zvezda,

If you just need to reset your file and folder permissions, assuming you have a standard host configuration that allows for permissions of 755:folder / 644:file, then:

1) Download Magento Clean Up Tool
2) Unzip magento-cleanup.php to the root of your magento installation
3) Browse http://yourdomain.com/magento/magento-cleanup.php

 
Magento Community Magento Community
Magento Community
Magento Community
 
zvezda
Jr. Member
 
Total Posts:  14
Joined:  2007-09-20
 

Thank you skippybosco
Unfortunately doesn’t work on my site. I got
Warning: chmod() [function.chmod]: Operation not permitted in http://yourdomain.com/magento/magento-cleanup.php on line 9

Do you have any idea why?

thank you

z

 
Magento Community Magento Community
Magento Community
Magento Community
 
skippybosco
Enthusiast
 
Avatar
Total Posts:  796
Joined:  2008-10-03
 

That would suggest that your web account does not have the required access to make permission changes to your Magento folders.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michal
Jr. Member
 
Avatar
Total Posts:  10
Joined:  2007-11-20
 

Thank you stuart, because of that “help” i’ve got now internal server error (500) well done.

Stuarts - 19 March 2009 09:18 AM

[b]14/ Once you have downloaded all the required programs from Magento Connect

then it is a good idea to reset your file permissions so that your server

isn’t compromised (ie By the directories being set to 777)

To do that, run the following in the same place (file wise) as for the

above instructions:

http://www.magentocommerce.com/wiki/groups/227/resetting_file_permissions

Here’s how to reset your file and directory permissions:

1. find . -type f -exec chmod 644 {} \;
2. find . -type d -exec chmod 755 {} \;
3. chmod o+w var var/.htaccess app/etc
4. chmod 550 pear
5. chmod -R o+w media

The above commands need to be executed from the root directory where

Magento is installed.

 
Magento Community Magento Community
Magento Community
Magento Community
 
artfusion
Jr. Member
 
Total Posts:  2
Joined:  2009-03-09
 

I have to say, the “help” above did the same thing to my installation.
What the heck is gogin on here, why is this so difficult? jeez just want to connect to magento connect. this should be a top priority for varien to get right and support

 
Magento Community Magento Community
Magento Community
Magento Community
 
georgeroz
Jr. Member
 
Total Posts:  1
Joined:  2009-10-03
 

In regards to what skippybosco said to use the clean up tool; if you use ssh to access, you can use the wget command to get the url in order for it to run if there is no web access permissions to use it through the browser.

 
Magento Community Magento Community
Magento Community
Magento Community
 
BAD311
Jr. Member
 
Total Posts:  17
Joined:  2009-09-24
 

Hey all, I installed 1.4.1.0 on a fresh domain.

I’m running into the issue where the menu links in the admin menu fail to work properly. Some of them work, but most of them do not.

I ran the magento-cleanup tool both in my browser and also in SSH. It cleaned everything up properly. I also then manually checked the chmod settings for various folders that the cleanup tool changed, all looks well.

However, the links in the menu still fail to work :(

Any ideas??

 
Magento Community Magento Community
Magento Community
Magento Community
 
dansksun
Jr. Member
 
Total Posts:  11
Joined:  2009-08-09
 

Perfect post
For those who want a really easy to use like FTP program to run SSH I recommend:
http://www.sshexplorer.com/

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top