Loading ...
Sorry, an error occurred while loading the content.

Apache2 w/ php problems

Expand Messages
  • m_knopp
    Hello, I am extremely new to linux. In fact this is the first time that I have tried using it. Anyway, here is my problem. I installed SUSE 9.0 professional
    Message 1 of 4 , Apr 5, 2004
    • 0 Attachment
      Hello,

      I am extremely new to linux. In fact this is the first time that I
      have tried using it.

      Anyway, here is my problem. I installed SUSE 9.0 professional this
      morning and had it install apache2, php4, and mysql initially. I
      have apache2 working fine with html. I can access the default
      webpage, among others. However, when I try and access a php file I
      receive the following messages.

      Warning: Unknown(/srv/www/htdocs/phpinfo.php): failed to open
      stream: Permission denied in Unknown on line 0

      Warning: (null)(): Failed opening '/srv/www/htdocs/phpinfo.php' for
      inclusion (include_path='.:/usr/share/php') in Unknown on line 0

      At first I thought that it might have been a permissions problem,
      but the same error occured when I run the server in root. So it
      isn't a problem of my server login not having the correct
      permissions. My next thought was that php wasn't loading correctly.
      However, according to YAST HTTP Server the module is enabled. I then
      thought that maybe php didn't install correctly, but running php -i
      produced the info html so it is running just fine. All that I can
      think of is that somehow eventhough YAST says that php is enabled it
      actually isn't. I also was not able to find anywhere that the
      AddType was entered in any of the .conf files or in YAST.

      Any help would be greatly appreciated.

      Thank you.
      Mike
    • Justin Churchey
      Make sure you do a chown -R apache:apache to the DocumentRoot just to be on the safe side of the permissions thing.
      Message 2 of 4 , Apr 6, 2004
      • 0 Attachment
        Make sure you do a "chown -R apache:apache" to the DocumentRoot just
        to be on the safe side of the permissions thing.

        --- In suselinuxusers@yahoogroups.com, "m_knopp" <taechunsa@h...> wrote:
        > Hello,
        >
        > I am extremely new to linux. In fact this is the first time that I
        > have tried using it.
        >
        > Anyway, here is my problem. I installed SUSE 9.0 professional this
        > morning and had it install apache2, php4, and mysql initially. I
        > have apache2 working fine with html. I can access the default
        > webpage, among others. However, when I try and access a php file I
        > receive the following messages.
        >
        > Warning: Unknown(/srv/www/htdocs/phpinfo.php): failed to open
        > stream: Permission denied in Unknown on line 0
        >
        > Warning: (null)(): Failed opening '/srv/www/htdocs/phpinfo.php' for
        > inclusion (include_path='.:/usr/share/php') in Unknown on line 0
        >
        > At first I thought that it might have been a permissions problem,
        > but the same error occured when I run the server in root. So it
        > isn't a problem of my server login not having the correct
        > permissions. My next thought was that php wasn't loading correctly.
        > However, according to YAST HTTP Server the module is enabled. I then
        > thought that maybe php didn't install correctly, but running php -i
        > produced the info html so it is running just fine. All that I can
        > think of is that somehow eventhough YAST says that php is enabled it
        > actually isn't. I also was not able to find anywhere that the
        > AddType was entered in any of the .conf files or in YAST.
        >
        > Any help would be greatly appreciated.
        >
        > Thank you.
        > Mike
      • m_knopp
        sajchurchey & otplsfriends, Thanks for the help. It turns out that the file had my server s user permission, but not the server s group permissions. Fixing the
        Message 3 of 4 , Apr 7, 2004
        • 0 Attachment
          sajchurchey & otplsfriends,

          Thanks for the help. It turns out that the file had my server's user
          permission, but not the server's group permissions. Fixing the group
          permissions has it running now.

          This does lead me to another question. Why couldn't root run the
          file? I thought that root had access to all user's files and all
          groups.

          --- In suselinuxusers@yahoogroups.com, "Justin Churchey"
          <sajchurchey@f...> wrote:
          > Make sure you do a "chown -R apache:apache" to the DocumentRoot just
          > to be on the safe side of the permissions thing.
          >
          > --- In suselinuxusers@yahoogroups.com, "m_knopp" <taechunsa@h...>
          wrote:
          > > Hello,
          > >
          > > I am extremely new to linux. In fact this is the first time that
          I
          > > have tried using it.
          > >
          > > Anyway, here is my problem. I installed SUSE 9.0 professional
          this
          > > morning and had it install apache2, php4, and mysql initially. I
          > > have apache2 working fine with html. I can access the default
          > > webpage, among others. However, when I try and access a php file
          I
          > > receive the following messages.
          > >
          > > Warning: Unknown(/srv/www/htdocs/phpinfo.php): failed to open
          > > stream: Permission denied in Unknown on line 0
          > >
          > > Warning: (null)(): Failed opening '/srv/www/htdocs/phpinfo.php'
          for
          > > inclusion (include_path='.:/usr/share/php') in Unknown on line 0
          > >
          > > At first I thought that it might have been a permissions problem,
          > > but the same error occured when I run the server in root. So it
          > > isn't a problem of my server login not having the correct
          > > permissions. My next thought was that php wasn't loading
          correctly.
          > > However, according to YAST HTTP Server the module is enabled. I
          then
          > > thought that maybe php didn't install correctly, but running php -
          i
          > > produced the info html so it is running just fine. All that I can
          > > think of is that somehow eventhough YAST says that php is enabled
          it
          > > actually isn't. I also was not able to find anywhere that the
          > > AddType was entered in any of the .conf files or in YAST.
          > >
          > > Any help would be greatly appreciated.
          > >
          > > Thank you.
          > > Mike
        • Horror Vacui
          On Wed, 07 Apr 2004 13:28:39 -0000 ... Yes, in that root can change all permissions to allow himself access. Otherwise... Try creating a file as root, chmod it
          Message 4 of 4 , Apr 7, 2004
          • 0 Attachment
            On Wed, 07 Apr 2004 13:28:39 -0000
            m_knopp wrote:

            > sajchurchey & otplsfriends,
            >
            > Thanks for the help. It turns out that the file had my server's user
            > permission, but not the server's group permissions. Fixing the group
            > permissions has it running now.
            >
            > This does lead me to another question. Why couldn't root run the
            > file? I thought that root had access to all user's files and all
            > groups.

            Yes, in that root can change all permissions to allow himself access.
            Otherwise... Try creating a file as root, chmod it to 440 and try to
            change or execute it, again as root. What happens?

            If root can override permissions, it doesn't mean that they're not
            valid.

            Cheers

            --
            Horror Vacui

            Registered Linux user #257714

            Go get yourself... counted: http://counter.li.org/
            - and keep following the GNU.
          Your message has been successfully submitted and would be delivered to recipients shortly.