Results 1 to 5 of 5

Thread: PHP write permissions

  1. #1
    Join Date
    Feb 2012
    Beans
    11

    PHP write permissions

    So I have a php script that I am installing on my ubuntu server. The php script that I have has an install via browser after copying the code files in. I go through the setup and on the last page it says it cannot write (create) the .htaccess file or the config.cfg file.

    Any ideas what I need to do to get permissions for the files to be made?

  2. #2
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    8,753
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: PHP write permissions

    Any files written by the apache web server will have user and group "www-data", the user and group that the server runs under. So any directory into which such files need to be written must be writable by the www-data user.

  3. #3
    Join Date
    Feb 2012
    Beans
    11

    Re: PHP write permissions

    Okay that solve the config file issue. But I'm still having issue with the .htaccess. Would that need something different?

  4. #4
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    8,753
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: PHP write permissions

    .htaccess files are disabled by default in Ubuntu. If you look at /etc/apache2/sites-available/default, you'll see an "AllowOverride None" entry for both / and /var/www. You can either change these defaults or, better, place the directives that would have gone into .htaccess in the <Directory> stanza of the virtual host that pertains to the software you're installing. If you change the defaults, you'll need to restart apache with "sudo service apache2 restart".

  5. #5
    Join Date
    Feb 2012
    Beans
    11

    Re: PHP write permissions

    Sweet I went ahead and just changed the defaults to "AllowOverride All". Thanks a ton!

Tags for this Thread

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
  •