The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - Newcomers (http://hintsforums.macworld.com/forumdisplay.php?f=15)
-   -   Big Permissions Problem (http://hintsforums.macworld.com/showthread.php?t=6721)

laram 10-29-2002 07:56 AM

Big Permissions Problem
 
Here's a strange problem. I've been trying to solve it for weeks and haven't even been able to find that any one has had a problem like this before.

Suddenly, after upgrading to OS 10.2.1, Dreamweaver's preview (and Live Data view) utility is now only able to generate temp pages with permissions set so that I get an error that says...

'Warning: Failed opening '/Library/WebServer/Documents/my_file.php' for inclusion (include_path='.:/usr/local/lib/php') in Unknown on line 0'

Or I get a warning that says access is forbidden. When I do a get info on one of these temp pages, the permissions are set so that the owner (me) has read and write privileges, the group (admin) has read only privileges and all others have no access (normally, I guess, all others would have at least read only privileges).

I have run the fix permissions utility on the OS X start up disk to no avail and I've tried re-installing Dreamweaver. It seems to me (humble newbie that I am) that perhaps some unix command is needed to make Dreamweaver create temp files with the proper permissions.

I use a Mac G4 (AGP) with 512 megs of ram with OS 10.2.1 and Dreamweaver MX. I also use PHP and MySQL.

Any advice? Thanks.

ericw13 10-29-2002 08:24 AM

I don't know anything about Dreamweaver, but you should check the following:

Who owns /Library/WebServer/Documents? ls -l /Library/WebServer/ | grep Documents ... check columns 3 (owner) and 4 (group). I have root and admin. Also check that the permissions are at least drwxr-xr-x or better (group write [first - is w instead] is better, and what I have).

Who owns the Dreamweaver job? ps auxww | grep Dreamweaver ... check the first column. If this is owned by you, and Dreamweaver is trying to write to /Library/WebServer/Documents, you will need write access to that directory.

You can either open up write access to everyone (sudo chmod a+w /Library/WebServer/Documents ... and likewise for any other directory under that) or you can add yourself to the group you identified above (Use NetInfo manager in Applications -> Utilities, select groups, then the correct group, and add your Unix username to the group).

If none of these work, it may be a Dreamweaver issue, rather than a Unix-level access issue.

HTH
Eric

laram 10-29-2002 03:25 PM

ericw13,

Here are my results...

==========================================
Last login: Tue Oct 29 14:36:09 on console
Welcome to Darwin!
[hipcat-computer:~] laram% ls -l /Library/WebServer/ | grep Documents
drwxrwxr-x 19 root admin 646 Oct 29 12:06 Documents
[hipcat-computer:~] laram% ps auxww | grep Dreamweaver
laram 497 0.0 0.1 1416 312 std S+ 3:10PM 0:00.01 grep Dreamweaver
[hipcat-computer:~] laram%
==========================================

I'm afraid I'm not sure if my results were good or not. Please let me know.

As for your suggestion to "open up write access to everyone (sudo chmod a+w /Library/WebServer/Documents ... and likewise for any other directory under that)", will this automatically make any new file created in this folder have all the same permissions?

And as for your other suggestion to "add yourself to the group you identified above (Use NetInfo manager in Applications -> Utilities, select groups, then the correct group, and add your Unix username to the group)", I'm already part of the group 'admin'.

Thanks for your info and your help!

ericw13 10-29-2002 04:33 PM

You should start Dreamweaver before doing ps auxww. The only thing you got from that was the grep process looking for processes with name like Dreamweaver!

Eric

laram 10-29-2002 08:56 PM

Sorry. Here it is...

====================================
Last login: Tue Oct 29 16:01:50 on ttyp1
Welcome to Darwin!
[hipcat-computer:~] laram% ps auxww | grep Dreamweaver
laram 781 3.4 7.5 109860 39520 ?? S 8:52PM 0:12.65 /Applications/Macromedia Dreamweaver MX/Dreamweaver MX/Contents/MacOS/Dreamweaver MX /Applications/Macromedia Dreamweaver MX/Dreamweaver MX/Contents/MacOS/Dreamweaver MX -psn_0_6291457
laram 786 0.0 0.0 1116 4 std R+ 8:52PM 0:00.00 grep Dreamweaver
====================================

ericw13 10-30-2002 08:28 AM

Well, the process is owned by laram. laram is part of the admin group, and the admin group has full access to /Library/WebServer/Documents. I'm at a loss here.

As for the permissions, just because a directory is wide open for all to read/write/execute does not mean that a file created in that directory will have the same privs.

To find out what the default permissions are, do this:

umask

This will give you a 3 digit number. Subtract this from 777. Quick translation... read = 4, write = 2, execute = 1. The first digit is the sum of the owner permissions, the second is the sum of the group permissions, the last is the sum of world permissions.

For instance, on my system, umask returns 022. 777-022 = 755.

This means any directory created has rwx for owner, and only rx for group and world. From what I can tell, if you are creating a file, not a directory, the execute permission is turned off by default... producing 644 (rw for owner, r for group and world).

How this helps you, I don't know... it may be a Dreamweaver configuration issue... can you try to write files to /Users/laram/Sites (assuming your /etc/httpd/httpd.conf contains the following)

<IfModule mod_userdir.c>
UserDir Sites
</IfModule>

and the line

AddModule mod_userdir.c

is not commented out (line should not start with #). If so, try to write to that dir. If that is successful (which it should be, as laram should own its own ~/Sites directory), you should be able to get to the page at http://localhost/~laram/my_filename.html

I hope this rambling helps in some way or another.

Eric

laram 10-30-2002 05:58 PM

Eric,

I seem to be doing the unmask command incorrectly. Here's what I get...

=======================================
Last login: Wed Oct 30 17:31:47 on console
Welcome to Darwin!
[hipcat-computer:~] laram% unmask
unmask: Command not found.
[hipcat-computer:~] laram% unmask /Library/WebServer/Documents
unmask: Command not found.
[hipcat-computer:~] laram%
=======================================

As for your recommendations about my httpd.conf file, I have the appropriate code uncommented and am able to use my (laram) site directory but still get the same permissions errors with Dreamweaver.

If only there was a way to get to the mechanism that creates the temp files. Perhaps resetting the permissions there could fix my problem. Or am I just showing off how little I understand?

I do appreciate your help. Please keep advising.

mervTormel 10-30-2002 06:04 PM

umask

not

unmask

laram 10-31-2002 03:20 PM

Me college grad. Me smart.

That's why I make a poor proof reader. Anyway, here's what I get...

==========================
Last login: Wed Oct 30 17:42:37 on ttyp1
Welcome to Darwin!
[hipcat-computer:~] laram% umask
22
[hipcat-computer:~] laram%
==========================

What can this mean?

mervTormel 10-31-2002 03:34 PM

umask 022 means that files are created with access owner=read/write, group+other=read
Code:

% umask 022

% touch poon

% ll poon
-rw-r--r--    1 merv    staff          0 Oct 31 12:27 poon

% man tcsh
...
/umask

^^^
search for umask

and consult unix tutorials...

http://www.google.com/search?hl=en&i...=unix+tutorial

laram 11-01-2002 07:23 AM

Thanks but is there any information here that will help find a solution to my problem? Or how about this; my wife and I are the only ones that use my computer. Is there a way to turn off all checks for permissions? Right now even logging in as root does not allow me to preview the pages I'm working on while in Dreamweaver.

BraindeadMac 11-01-2002 09:15 AM

Quote:

Originally posted by laram
Thanks but is there any information here that will help find a solution to my problem? Or how about this; my wife and I are the only ones that use my computer. Is there a way to turn off all checks for permissions? Right now even logging in as root does not allow me to preview the pages I'm working on while in Dreamweaver.
You should probably try running the Disk Utility Repair Permissions command. Note this is different from the standalone permissions repair program which apple made available for 10.1.5. Launc Disk Utility, select the boot up hard disk, and select the Repair Permissions button.

laram 11-02-2002 07:30 AM

Thanks, BrainDead, but this has already been done and did not solve the problem.

laram 11-11-2002 12:45 PM

FYI. I just had my brother in law try using dreamweaver on his computer (he uses Jaguar too) and he gets the same problem I do. Is there any one else that has the same Dreamweaver/Permissions problem that I do?

hayne 11-14-2002 03:03 AM

more info needed
 
I'm coming in late on this discussion, but I fail to see any hard evidence that the basic problem is one of permissions at all. The only detailed error message you gave was:
Quote:

'Warning: Failed opening '/Library/WebServer/Documents/my_file.php' for inclusion (include_path='.:/usr/local/lib/php') in Unknown on line 0'
That doesn't look like a permissions problem to me. But I don't know what the various files mentioned are. What is my_file.php - is that something you have created? What does it mean by "inclusion" ? What is it trying to include? I presume this is PHP code trying to include a PHP file. Maybe the include path is wrong. What is the include line - i.e. what file is it trying to include and where is this file?

[edit: readability -mt]

laram 11-14-2002 07:54 AM

Well, Hayne, that is part of the mystery of the error message. There is no include but I'm almost certain that the problem has to do with the fact that the temp file that is generated by Dreamweaver for previewing purposes has its permissions set so that access is denied to to any who wish to see it. As stated above, 'the permissions are set so that the owner (me) has read and write privileges, the group (admin) has read only privileges and all others have no access'. When I try to view a Dreamweaver generated html file (as opposed to a php file), I get a '403 Forbidden' error. I have managed to go into my /Library/WebServer/Documents/ folder and changed the bad permission manually on such files and then was able to gain access via my web browser. Meanwhile, php files generated by JaneBUILDER, for example, always have at least permissions set to 'read only'.

Also, as stated before, my brother in law gets the same errors on his computer on his freshly installed copy of Dreamweaver using OS 10.2.1. I did not get these errors on 10.1.x. This makes me wonder if this is a problem with Jaguar and so I ask all of the readers of this forum who use Dreamweaver on Jaguar to let me know how things are with them.

Hayne, I really don't know what else I could add but if you can think of more questions I'd be happy to answer them. I'm really stumped and can use all the help I can get.

Thanks.

P.S.

To answer one of your first questions, 'my_file.php' simply represents any php file that I've edited in Dreamweaver.

hayne 11-14-2002 02:21 PM

narrow down the problem
 
Let's try to narrow down the problem by dealing onlyt with pure HTML files - in other words, don't do anything that uses PHP. (Just for the purpose of testing to figure out what the real problem is)

So please do your Preview or whatever it is in DreamWeaver (I don't have it so can't be specific) so that the temporary file is created.

Where is this temporary file ? (give us the full path)
Using the Terminal, go to that folder by using the 'cd' command
E.g.:
cd /whatever/the/path/is/to/that/folder

Now tell us the results of the following commands in Terminal:

ls -ld .
ls -l name_of_temp_file
(where "name_of_temp_file" is whatever the name of the temporary file is)

It seems from what you have said previously that this temp file has no permissions for "other" but let's just check it this way - it may give us a clue.

laram 11-15-2002 08:37 AM

The path to the directory where my web files are kept is...

/Library/WebServer/Documents/

I call my hard drive 'Earbrass' and, in this case, I'm editing a file called index.html, so the full path would be...

Earbrass/Library/WebServer/Documents/index.html

As for the commands you suggested I use; here's what I get while editing index.html (the Dreamweaver generated temp file that should allow me to preview my edits, in this case, is called 'TMPgae65lz31.html' - Dreamweaver places it in the same directory as index.html)...

========================================
Last login: Fri Nov 15 08:19:52 on ttyp1
Welcome to Darwin!
[hipcat-computer:~] laram% cd /Library/WebServer/Documents/
[hipcat-computer:/Library/WebServer/Documents] laram% ls -ld .
drwxrwxr-x 24 root admin 816 Nov 15 08:18 .
ls -l TMPgae65lz31.html[hipcat-computer:/Library/WebServer/Documents] laram% ls -l TMPgae65lz31.html
-rw-r----- 1 laram admin 296 Nov 15 08:18 TMPgae65lz31.html
[hipcat-computer:/Library/WebServer/Documents] laram%
========================================

I hope this helps. Thanks.

hayne 11-15-2002 11:47 AM

Well it does seem that Dreamweaver is creating the temp files with the wrong permissions. Strange.
I assume that you have looked in the Dreamweaver preferences to see if there is some option to set permissions.

Could you please try one more thing - create a file using Text Edit (it doesn't matter what the contents of the file are) and then show us the result of
ls -l the_newly_created_file
where "the_newly_created_file" is replaced by whatever name you gave to the file.

laram 11-16-2002 07:34 AM

Here I created a file named blah.rtf...

============================
Last login: Fri Nov 15 08:24:18 on ttyp1
Welcome to Darwin!
[hipcat-computer:~] laram% ls -l /Users/laram/Desktop/blah.rtf
-rw-r--r-- 1 laram staff 289 Nov 16 07:23 /Users/laram/Desktop/blah.rtf
[hipcat-computer:~] laram%
============================

As you can see, all entities can at least read this file.

As for the preference settings in Dreamweaver; great idea to have me check, but sadly there are no settings that deal with levels of permissions in Dreamweaver.

slmonn 07-20-2003 11:53 PM

More evidence
 
I have been having similar problems with Contribute from Macromedia. I cannot establish a verified connection setup that would allow me to use it with a web site that runs on OS X, not server but plain OS X. I have done extensive testing and spent a lot of time with Macromedia support and some with Apple.

In my testing, I discovered that if I create a new file via ftp (even from the same system), the rights for "others" is always the same - no rights, not even read regardless of the folder's inheritable privileges. It seems to hold true for any folder not just /Library/WebServer/Documents/. This is the root of my problem as Contribute creates a test file via ftp and then attempts to access it via anonymous http protocol. Since the file is created with no rights for "others", the test fails.

I have discovered that if a file already exists with read rights for others and is replaced using ftp, it will retain those rights. This does not help with my Contribute problem as Contribute, for some bizarre reason, generates a random file name which I cannot predict. But if Dreamweaver always uses the same test file name, you could create the file in advance, adjust the privileges, and then run the site setup. When Dreamweaver's test is run and the file is replaced, it should be readable. It should work.

Of course you will still have to remember to "fix" the privileges on all new files you create with Dreamweaver but you may at least be able to do something with it.

Apple support tells me that this is controllable under OS X server but not in plain OS X. They also indicated that they do not know if it would be changed in the future.

Please remember not to assume that the solution to people's problems are always simple things that they simply have not thought of or tried. Before offering a solution, test it yourself first, if you can. Then if your theory works, suggest it. This can save a lot of agravating and unnecessary hoop-jumping.

Now, if you have a solution to this problem, I would be very, very interested as well.

Thanks for all the interesting discussion.


All times are GMT -5. The time now is 10:34 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.