Author Topic: Directory- and File Permission  (Read 10653 times)

0 Members and 1 Guest are viewing this topic.

Legolad

  • Member
  • **
  • Posts: 23
Directory- and File Permission
« on: April 20, 2010, 05:46:33 AM »
In my installation I am seeing a warning about permissions.



I cannot seem to change the permissions.

For example, I right-clicked the Smarty folder and chose File Attributes.
In the dialog I see all the permissions for Owner, Group and Public.

I change the numeric permissions to 777.
But when I click OK I see an error:
   550 CHMOD 777 smarty: Permission denied

Legolad

  • Member
  • **
  • Posts: 23
Re: Directory- and File Permission
« Reply #1 on: April 20, 2010, 05:49:21 AM »
here's the screenshot

fathex

  • Team
  • Bigace Pro
  • *****
  • Posts: 133
Re: Directory- and File Permission
« Reply #2 on: April 20, 2010, 10:27:14 AM »
This is the usual problem when you are not the (unix) owner of the files. Try to get to your hoster's administration panel and change the the owner from wwwrun to your ftp user account. After that you can change permissions.

Otherwise try the php function chmod(). Examples can be found on http://www.php.net/manual/en/function.chmod.php
However, this might not be without risk...

Kevin

  • Global Moderator
  • Bigace Guru
  • *****
  • Posts: 3139
    • Kevin Papst
Re: Directory- and File Permission
« Reply #3 on: April 20, 2010, 02:22:07 PM »
How did you install Bigace?
I assume you uploaded the two files and used the automatic extraction?
In that case all permissions should be correct...

Hm - yes please try to change through the hosters admin panel first. If that does not work I will create a small script that helps fixing file/directory permissions.

Oh, there is one more option actually: You could edit the install_bigace.php file and find these lines:
Code: [Select]
define('DIRECTORY_PERMISSION', 0777); // 0645
// permissions for all created files, should work in most cases out-of-the-box
define('FILE_PERMISSION', 0777);
// the user mask settings, don't change if you are not sure what this is!
// define('ACCESS_UMASK', 0022);

Change to your needs (e.g. 777 for testingt) and re-run the script. See if that fixed your problem.

Legolad

  • Member
  • **
  • Posts: 23
Re: Directory- and File Permission
« Reply #4 on: April 21, 2010, 09:32:06 PM »
Thanks again.

If I edit the install.php file and re-run the install, do I need to delete all the items from the previous install?

Kevin

  • Global Moderator
  • Bigace Guru
  • *****
  • Posts: 3139
    • Kevin Papst
Re: Directory- and File Permission
« Reply #5 on: April 22, 2010, 11:13:21 AM »
Normally not, just try out and see what happens ;)

Legolad

  • Member
  • **
  • Posts: 23
Re: Directory- and File Permission
« Reply #6 on: April 22, 2010, 10:28:50 PM »
Okay...I think I figured out the problem.

The four directories that the installer is seeking do not exist.
Here is how my directories look after a fresh installation.

The install checker thinks it does not have write permissions to these directories:
/bigace/addon/smarty/cache/
/bigace/addon/smarty/templates_c/
/bigace/system/admin/smarty/cache/
/bigace/system/admin/smarty/templates_c/

But these directories do not exist after installation. Could that be the reason?
« Last Edit: April 24, 2010, 11:16:10 PM by Legolad »

Legolad

  • Member
  • **
  • Posts: 23
Re: Directory- and File Permission
« Reply #7 on: April 24, 2010, 02:46:09 AM »
Sorry Kevin. I forgot to answer your original question and I left out some details about the steps I took.

Here is how I performed the installation:
1. I created a bigace directory at the root level of my FTP site.
2. I uploaded the 2 files (install.php and bigace_install_2.7.1.zip) to the bigace directory.
3. I pointed all my domains to the bigace directory.
4. I pointed my browser to www.leg0lad.com/bigace/install.php
5. When prompted, I clicked the INSTALL button.
6. I waited for the successful message.
7. I moved the 2 files (install.php and bigace_install_2.7.1.zip) to a temp directory outside of the bigace directory (I will delete them later)
8. I clicked Start Installation
9. Then I got the message about those 4 directories not having write permissions.

Later, I contacted my webhost and ask about the permissions. I ask them to check all the directories. That is when I noticed that the same 4 directories that needed write permissions did not get created by the BIGACE installer.

I hope this helps.

Thanks again for all your assistance. I will be sure to update the documentation with the things I learn.

Cheers!

Kevin

  • Global Moderator
  • Bigace Guru
  • *****
  • Posts: 3139
    • Kevin Papst
Re: Directory- and File Permission
« Reply #8 on: April 24, 2010, 01:47:44 PM »
Okay, I checked the installer and found the problem. There are server systems, which do not inflate empty directories from a ZIP file (like yours).
If you have a look inside the bigace_install ZIP file, the directories should be there - but I believe your system skipped them for any reason...

There was code to create such missing empty directories, but it was executed after this "checkup" screen - which is a ridiculous bug in itself ;)

I fixed that in CVS and recreated the Nightly packages for today. Head over to http://www.bigace.de/nightly-builds.html and fetch the bigace_2.7.1.zip file. You can simply extract all files and replace the complete misc/install/ folder of your current system.

I hope it works now - or at least gives you proper feedback about existing problems!

Thanks for finding this bug :)
« Last Edit: April 24, 2010, 01:49:32 PM by Kevin »

Legolad

  • Member
  • **
  • Posts: 23
Re: Directory- and File Permission
« Reply #9 on: April 24, 2010, 05:31:27 PM »
Always happy to help find bugs   ;D
I replaced the /misc/install directory.
Then I clicked the Re-Check button.

The next result confused me (See attached). I was expecting it to list all the directories and show green lights. Instead, it did not list any directories.

I deleted everything and did a clean install. I got the same results.

Is this screen (no green lights) a good result?
« Last Edit: April 24, 2010, 11:21:04 PM by Legolad »

Kevin

  • Global Moderator
  • Bigace Guru
  • *****
  • Posts: 3139
    • Kevin Papst
Re: Directory- and File Permission
« Reply #10 on: April 24, 2010, 06:37:59 PM »
Hmpf, you give me a hard time ;)
Yes, its a good sign, I changed the behaviour, so user see this message only if there is really something wrong with permissions.
But obviously I forgot to check if there is at least one error, I'll fix that and you go on testing!

Legolad

  • Member
  • **
  • Posts: 23
Re: Directory- and File Permission
« Reply #11 on: April 24, 2010, 09:29:10 PM »
Hi Kevin,

It's me, your troublesome friend again  ;)

This time I think I don't have enough experience to follow the instructions. It is probably obvious to some users, but I don't know very much about PHP or SQL so I am uncertain what I should put into these fields (see image #10).
   Database
   User
   Password
I think the User and Password must be the same as my FTP login, is that correct?

If not, then maybe this is the answer.
I found a MySQL manager page on my WebHost (see image #11).
It looks like this will allow me to create a database (see image #11 create).

Maybe I need to create a new database and use that information for all the fields in image #1?
« Last Edit: April 24, 2010, 11:36:16 PM by Legolad »

Kevin

  • Global Moderator
  • Bigace Guru
  • *****
  • Posts: 3139
    • Kevin Papst
Re: Directory- and File Permission
« Reply #12 on: April 24, 2010, 09:41:17 PM »
Actually I like your detailed questions, it shows me where improvement is still necessary!

For your current problem there are two ways to go:
1. You can enter a user and password (in the installer) who is allowed to create a database, Bigace will do the rest for you.
2. Create a database and enter this information in the installer.

Bigace checks if the given database already exists and if not, tries to create it.
Normally your hoster will not give you a user who is allowed to create database, they just allow that through their web-frontend (unless you don't have a virtual-or-managed-server). Thats why most people need to go the second way.

Often your hoster sends you the correct database username and password in an initial email after buying the webhosting, sometimes you can look it up in their web-administration. But that totally depends on your hoster - if you can't find it write an email to their support.

So, I would say "YES" to  your very last question ;) You can't destroy anything here :D

Legolad

  • Member
  • **
  • Posts: 23
Re: Directory- and File Permission
« Reply #13 on: April 24, 2010, 10:34:44 PM »
Okay. We are making progress.  ;D

I now have an empty database (see image #13).
I can now open PHPMyAdmin (see image #12).

When I continue the installation I get a login error (see image #14).

I think the user ID and password are okay.
It is probably the localhost entry that needs to be changed. What do you think?



BTW - the next time I come to Germany, I owe you a beer or something!
« Last Edit: April 24, 2010, 11:34:50 PM by Legolad »

Kevin

  • Global Moderator
  • Bigace Guru
  • *****
  • Posts: 3139
    • Kevin Papst
Re: Directory- and File Permission
« Reply #14 on: April 24, 2010, 10:37:04 PM »
Yes, I guess so. See your last posting, screenshot
* BigAce 11 - My SQL.png

Its cut off, so I can't read it completely ... its starts with:
MySQL Server Name: leg0lad.readyhost

Try that value instead of localhost.