5

I am trying to setup Magento (community edition 1.9.1) on our shared hosting server. I am pretty new to Magento, though I did get a dummy site set up fairly easily on a local machine.

The problem that I am facing is that whenever I try to install an extension through Magento Connect I get various cannot write, cannot access etc errors.

I have set all the permissions to 777 via Filezilla, but there are certain files that are created by Magento that I cannot modify via FTP. If I log into the plesk panel for the site it says that those files/folders have the user Apache, and I can only modify them through the file manager interface. I can get it to proceed to some extent by manually creating the folders it is asking for through file manager but obviously this is slow and tedious and ultimately I still end up with a giant list of inaccessible files.

I hoped to get around this by using the FTP deployment but that give me error:

deployment ftp error. cannot chdir after login

Is there something that I am doing wrong? I have spent the day ploughing through google searches and forum posts and none of the solutions there seem to solve the problem. Do I need to contact the hosting provider?

5

Be thankful you're getting permission errors -- there's a few cases where Magento Connect runs into permission problems but reports the extension as installed.

What you need to do is going to depend heavily on how you're running PHP/Apache, but making an educated guess based on the contents of your post

  1. Magento needs write access to write to files/directories
  2. Which means PHP/Apache needs write access to files/directories
  3. If PHP/Apache creates a files and the web server is running under a generic apache user, then PHP/Apache should have all the access it needs.

So, when you say

there are certain files that are created by Magento that I cannot modify via FTP.

These are files and directories you don't need to worry about changing permissions for. If Apache/PHP created these files, then Apache/PHP doesn't need them to be 777 to modify them.

Files that you create "need" 777 permission so Apache/PHP can write them. Concentrate on that, and then debugging specific problems reported by Connect, and you should be good to go.

(I say "need" because brute force 777ing things still strikes me as a poor design decision, but that's a different post)

Update: Per the comment I'm about to add below, if you need to change the permissions of an Apache create folder, creating a small PHP script

<?php
    chmod('/path/to/file/or/folder', 0777);

and then running it in a web context is one way to do that.

|improve this answer|||||
  • Thanks for the reply. The folders/files that Connect is having trouble accessing are those ones that Apache is creating, once it creates them it seems like it cannot access them. – fiona Dec 15 '14 at 19:23
  • @fiona That's -- odd -- are you running connect from the command line? Or running it from the browser? Because if a browser can't access a directory it created something weird is going on (or your host's setup in a way I haven't seen before) Updated the question with some tips on how to change permissions on web owned files. – Alan Storm Dec 15 '14 at 20:31
  • I am running from browser, I could believe that our hosting is a bit strange. I managed to find a work around for now though I don't think its ideal. Thanks for the help. – fiona Dec 16 '14 at 16:13
  • What is chmod('/path/to/file/or/folder', 0777); , please explain in detail. – Pratik Jul 7 '15 at 6:19
1

You need to check with your hosting provider on whether they are running SuPHP or SuExec as the file permissions will be different.

If the server is using SuPHP or SuExec, all files should be set to 644 and all directories should be set to 755 (instead of 666 and 777 which are not secure).

You may also need to make sure that the files ownership are all correct and unless you have SSH access, this will need to be checked with your hosting provider as well.

|improve this answer|||||
0

If the following files exist try removing (or renaming if you prefer to be safer) them.

downloader/connect.cfg

downloader/cache.cfg

These are generated by Magento the first time you use connect. The cache file stores a full path to your install, so when you move to a new server this likely isn't a valid path.

|improve this answer|||||
0

I had to change the permissions for the directories and files with in the /downloader folder to 755/655 to get connect manger to not give a 500 error, i also had to do this to several other directories/files for other various errors updating.

|improve this answer|||||

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.