Results 1 to 6 of 6

Thread: PHP install fail

  1. #1
    Join Date
    Jun 2013
    Beans
    45

    PHP install fail

    Hello,

    Wanting to set up a Raspberry PI (running a Debian Wheezy Distro), )as a web server. I decided to do my learning on a Lubuntu 13.04 box first. in part because this box is much faster.

    I installed Lighttpd, mySQL, and PHP5 in that order (althogh mySQL seems to have already been on.
    I used the following pages as guides
    ---http://elinux.org/RPi_webserver
    ---https://help.ubuntu.com/community/lighttpd
    ---http://www.penguintutor.com/linux/light-webserver
    ---https://www.linux.com/learn/docs/ldp/285394-installing-lighttpd-with-php5-on-ubuntu-910

    All the pages end with create a small test.php file in folder /var/www, making a phpinfo() call.
    And ALL of these pages assume that this will work when you try to run it on your designated serve
    NONE go the next step and work on the premise that this does not work

    I'm getting an 40 - Forbidden error when I try
    localhost/test.php or [serverhostname]/test.php
    Even a Perl "hello World" file, test.pl gives the same error

    Apparently the /var/www directory belongs to "root" and it won't let anyone else have access.
    Last edited by CharlesA; June 29th, 2013 at 03:37 PM. Reason: changed prefix

  2. #2
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: PHP install fail

    Check your permissions.

    /var/www/ should have defaulted to root:root with rwx-rwx-r-x permissions.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  3. #3
    Join Date
    Nov 2008
    Location
    Storybrooke
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: PHP install fail

    Quote Originally Posted by NuxNik View Post
    Hello,

    Wanting to set up a Raspberry PI (running a Debian Wheezy Distro), )as a web server. I decided to do my learning on a Lubuntu 13.04 box first. in part because this box is much faster.

    I installed Lighttpd, mySQL, and PHP5 in that order (althogh mySQL seems to have already been on.
    I used the following pages as guides
    ---http://elinux.org/RPi_webserver
    ---https://help.ubuntu.com/community/lighttpd
    ---http://www.penguintutor.com/linux/light-webserver
    ---https://www.linux.com/learn/docs/ldp/285394-installing-lighttpd-with-php5-on-ubuntu-910

    All the pages end with create a small test.php file in folder /var/www, making a phpinfo() call.
    And ALL of these pages assume that this will work when you try to run it on your designated serve
    NONE go the next step and work on the premise that this does not work

    I'm getting an 40 - Forbidden error when I try
    localhost/test.php or [serverhostname]/test.php
    Even a Perl "hello World" file, test.pl gives the same error

    Apparently the /var/www directory belongs to "root" and it won't let anyone else have access.
    lighttpd (I think?) runs with the user www-data:www-data.

    try something like
    Code:
    sudo chown -R www-data:www-data /var/www
    If you want the settings to stick (i.e. even if you create files using another user there), do something like
    Code:
    sudo chmod -R 2770 /var/www
    After running the chown command above to make the group 'sticky' (All files created under /var/www will always be owned by www-data). Its kind of handy, as when you create files there using the root account, the files are owned by root user and root group. The above forces the files to be owned by the root user and the "www-data" group.
    Ubuntu Forums Moderation Staff
    Okay then. We're relying on mirror dust and fairies but now we have a plan which is progress - Emma

  4. #4
    Join Date
    Jun 2013
    Beans
    45

    Re: PHP install fail

    Thank you

    Sorry for the delayed response. But I was distracted by 2 National holidays in the past week.

  5. #5
    Join Date
    Jun 2013
    Beans
    45

    Re: PHP install fail

    Quote Originally Posted by sandyd View Post
    lighttpd (I think?) runs with the user www-data:www-data.

    try something like
    Code:
    sudo chown -R www-data:www-data /var/www
    If you want the settings to stick (i.e. even if you create files using another user there), do something like
    Code:
    sudo chmod -R 2770 /var/www
    After running the chown command above to make the group 'sticky' (All files created under /var/www will always be owned by www-data). Its kind of handy, as when you create files there using the root account, the files are owned by root user and root group. The above forces the files to be owned by the root user and the "www-data" group.
    ------------------------------------

    Thanks.
    I've been distracted and this has fallen to nearly bottom of the todo pile

    Hopefully, I can try this out ASAP..

    Will adivse of results obtained.

  6. #6
    Join Date
    Jun 2013
    Beans
    45

    Re: PHP install fail

    Tried it
    I worked.
    Log into to my notes for future reference

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
  •