Premission Problems

I have tried the upgrade od 2.1.4 to 2.2.1

First problem I run into is “The following files do not have write permissions. You need to set these permissions manually or use FTP to access the files (if not used already)”

As I have been going through the list of files they all seem to be set as 644 so I have been changing them to 666.

Next there are whole directories that are not present but in the list above. ./lib/js/ the js directory is not present on my system. Many times if I can find a directory below ./lib/ that matches the above list ./lib/js/directory and change the permissions to 666 and run the check again it fixes it. but still alot of directory structure not there.



I wonder if some of it is addons that are not install, just a wild guess. Hope someone has some ideas on this.



Thanks,

David DeWitt

Odds are the problem is with “ownership” of the files rather than permissions. If a file is owned by 'foo' and mode 644, when a user other than 'foo' tries to write to it, it will fail. However, anyone can read it.



Before you change all the permissions, have your host set the ownerships correctly for your site.



I do not believe there is any 'lib/js' directory structure in standard cs-cart. A correctly built 3rd party addon would not put files there and that wouldn't be done by an upgrade anyway.

Good Morning tbirnseth,



I am working with this on my dev server. so its all up to me. This just a simple ubunto with ISPConfig 3 to all easy setup for different test sites. currently owner is the client setup in ISPconfig. So who should be the owner of the files? And I guess that all files and directories should be changed to this owner?



thanks for your help,

David

Here are a couple screen shots. Hopefully once I can find out who should own the files all will be good. But the strange thing to me is that the directory of the update (image 1 and 2) don't match the install. image 3 just shows current permissions and group and owner, don't know if this would be of any help.

Thanks again, David



[attachment=4300:update-1.jpg] image 1

[attachment=4301:update-2.jpg] image 2

[attachment=4302:update-3.jpg] image 3

update-1.jpg

update-2.jpg

update-3.jpg

It is whatever ownership (user id) that PHP runs as. That should be the owner of your files and depending on your php configuration, you might need a certain group too so that Apache can access correctly. But I'm guessing it is just ownerships.

Create a php file in the root of your store named 'test.php' and put in it:

```php


```

Then execute that php script and look at the ownerships of 'test_me.txt'. This will tell you what ownership php is running as.

tbirnseth,



tried that in the websites root directory, all I got was a blank white screen in my browser. So I then copied it to a another domain on the same server that I use for learning php, which goes slowly for me. When I tried to run it there I get this message displayed in the browser.

Warning: file_put_contents(test_me.txt): failed to open stream: Permission denied in /var/www/clients/client1/web7/web/test.php on line 1



Any other thoughts on this.



thanks for your continued support,

David DeWitt

Then PHP can't write to the root directory of your store. Contact your host or determine what User ID PHP is running as.

You might be able to get it from a 'ps aux' and looking at the UID column for cgi processes.



Sorry, all I can do from here.

tbirnseth,

Thanks for the help. I used the proces status command as suggested, and found a likely user, then tested by changing group:user on one known file and it came off the bad list. Tried on a couple others, then rest of files on site. The upgrade process went smoth after that. Looks like I have some changes in fn.catalog.php Only thing is I don't think I made any. I do remember having to replace it, so I think I may have replaced it with the wrong version. Here are the first 20 lines from the file change. I see that the copyright line and the $Id lines changed.




```php
/***************************************************************************

  •                                                                      *
  • Copyright (c) 2004 Simbirsk Technologies Ltd. All rights reserved. * <-old line
  • (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev * ← new line
  •                                                                      *
  • This is commercial software, only users who have purchased a valid *
  • license and accept to the terms of the License Agreement can install *
  • and use this program. *
  •                                                                      *

****************************************************************************

  • PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE *
  • “copyright.txt” FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. *

    ****************************************************************************/





    //

    // $Id: fn.catalog.php 11907 2011-02-24 11:30:46Z klerik $ ← old line

    // $Id: fn.catalog.php 12865 2011-07-05 06:57:22Z 2tl $ ← new line

    // ```





    One other thing problem is I get a warning message from IE Stop running this script? A script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer might become unresponsive.

    How should I go about figuring out this problem?



    Thanks,

    David dewitt

For your first issue, I would definitely use the core/fn.control.php that was distributed with the release rather than the old version.



No idea on the IE warning.

Thanks tbirnseth,

The first question was more of just an observation of coarse I'll keep the latest file.

I think I'll start a new thread for the second question.



Dave