Results 1 to 10 of 10

Thread: Can't save php files to /var/www

  1. #1
    Join Date
    Mar 2008
    Location
    Melbourne, Australia
    Beans
    61

    Can't save php files to /var/www

    Hi Guys.

    I'm really hoping that someone here can help. I'm running Ubuntu 9.10 in a virtual machine and trying to do some work with php. I'm using Bluefish editor to create a very simple file that will show the date on a web page. The problem is that I try to save the file and get the following error:

    Error opening file '/var/www/today.php': Permission denied.

    Obviously it's a permissions issue. So I followed the instructions found in this post:

    http://ubuntuforums.org/archive/index.php/t-135530.html

    but alas, I keep getting the error.

    Any help would be greatly appreciated.

    All the best,

    Tim.
    "`Ford, you're turning into a penguin. Stop it.'"

    Registered Linux User #469706.

  2. #2
    Join Date
    Sep 2007
    Location
    Tōkyō, Japan
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Can't save php files to /var/www

    Could you please post the output of
    Code:
    ls -l /var

  3. #3
    Join Date
    Jun 2009
    Location
    NSW Australia
    Beans
    124
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Can't save php files to /var/www

    This should do the trick:
    sudo chown -R $USER:$USER /var/www

    Alternatively, if you need to write to or edit a file, use 'gksudo gedit <filename>'.
    If you need to do any moving/copying to that area, use 'sudo mv'.
    Last edited by nathan726; June 20th, 2010 at 10:42 AM.

  4. #4
    Join Date
    Mar 2008
    Location
    Melbourne, Australia
    Beans
    61

    Re: Can't save php files to /var/www

    NCLI, here's the output you were after:

    drwxr-xr-x 2 root root 4096 2010-06-20 18:51 backups
    drwxr-xr-x 23 root root 4096 2010-06-20 17:47 cache
    drwxrwxrwt 2 root root 4096 2009-10-16 03:29 crash
    drwxr-xr-x 2 root root 4096 2009-10-29 08:02 games
    drwxr-xr-x 66 root root 4096 2010-06-20 18:29 lib
    drwxrwsr-x 2 root staff 4096 2009-10-20 11:04 local
    drwxrwxrwt 3 root root 60 2010-06-20 18:51 lock
    drwxr-xr-x 18 root root 4096 2010-06-20 18:51 log
    drwxrwsr-x 2 root mail 4096 2009-10-29 07:55 mail
    drwxr-xr-x 2 root root 4096 2009-10-29 07:55 opt
    drwxr-xr-x 18 root root 680 2010-06-20 18:37 run
    drwxr-xr-x 6 root root 4096 2009-10-29 07:58 spool
    drwxrwxrwt 3 root root 4096 2010-06-20 18:42 tmp
    drwxr-xr-x 2 root root 4096 2010-03-07 16:12 www


    Looking at that -and with my limited knowledge of Linux- it would appear that I don't have write access, is that right?

    Nathan... I know that would work, but I was sort of hoping to use that as a last resort.

    Thanks for your responses guys, much appreciated.

    Tim.
    "`Ford, you're turning into a penguin. Stop it.'"

    Registered Linux User #469706.

  5. #5
    Join Date
    Mar 2008
    Location
    Melbourne, Australia
    Beans
    61

    Re: Can't save php files to /var/www

    Hi NCLI.

    I've fixed the problem. What I had done was put a wildcard at the end of the command.

    I had "chmod g+rw /var/www/*" which of course gave me access to any folders inside www. I took out the wildcard, and the rest -as they say- is history. Thank you so much for your post because I never would have seen the problem without it.

    All the best,

    Tim.
    "`Ford, you're turning into a penguin. Stop it.'"

    Registered Linux User #469706.

  6. #6
    Join Date
    Sep 2007
    Location
    Tōkyō, Japan
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Can't save php files to /var/www

    Glad to hear it, remember to mark as solved

  7. #7
    Join Date
    Mar 2008
    Location
    Melbourne, Australia
    Beans
    61

    Re: Can't save php files to /var/www

    I tried to do that but I couldn't see how mate. I'll keep looking though.
    "`Ford, you're turning into a penguin. Stop it.'"

    Registered Linux User #469706.

  8. #8
    wojox is offline I Ubuntu, Therefore, I Am
    Join Date
    Apr 2009
    Beans
    8,628

    Re: Can't save php files to /var/www

    Quote Originally Posted by Timbothecat View Post
    I tried to do that but I couldn't see how mate. I'll keep looking though.
    Up at the top under Thread Tools

  9. #9
    Join Date
    Mar 2008
    Location
    Melbourne, Australia
    Beans
    61

    Re: Can't save php files to /var/www

    Found it... what a silly bunt.
    "`Ford, you're turning into a penguin. Stop it.'"

    Registered Linux User #469706.

  10. #10
    Join Date
    Feb 2011
    Beans
    6

    Re: Can't save php files to /var/www

    This was the help I needed. I am using bluefish and I was trying to find how to raise permissions for bluefish(if that is possible) rather than lower the folder permissions, but what ever. It worked.
    Daren

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •