[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to activate php in apache



On 12/3/2013 3:03 AM, Bob Proulx wrote:
Jerry Stuckle wrote:
Bob Proulx wrote:
does not work in /var/wwww (with 644 permissions)

How did /var/www get 644 permissions?  That is also incorrect.

   chmod u=rwx,go+rx /var/www

'x' is not required for Apache php scripts.  Unlike PHP CLI, the
script itself is not an executable file (note the lack of a
shebang).

While absolutely correct who is talking about a script?  Look again.
/var/www is a directory not a script.  The 'x' bit on directories
allows them to be searchable.  It is necessary for the /var/www
directory.  If you take that away then you will get a 403 Forbidden
error.


The OP is talking about a script.  Look again:

"does not work in /var/wwww (with 644 permissions)".

He's talking about a script in the directory, not the directory itself.

I saw the OP called it "/var/wwww" with an extra 'w' in there.  But I
give the benefit of the doubt and call it a typo and that they really
meant "/var/www" there unless I learn otherwise.


Yes, a script in /var/www.

The ownership is not critical.

On a shared web server, ownership is critical.  The file should not
be owned by the web server, but the web server should be in a group
that has read access to the file.  This prevents other users from
accessing the file.

By default it is root:root.  By not critical I meant that if they had
already changed the ownership to someone else such as to themself that
the php function would still function.  Since they had already changed
the mode of the directory I think it likely that they changed the ower
and group too.  But that won't be the reason that php scripts are not
being interpreted for them.  Since I expected that most people group
user, group and mode together and I already gave instructions for
setting the mode the most natural thing would have been to assume that
they had messed up the owner or group too.

Bob


Ownership of the directory is root:root, but the scripts should *never* be owned by root:root.

Jerry


Reply to: