Safe mode

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • zeman

    Safe mode

    Hi all,
    i'm new at PHP.
    it's running on Linux RedHat, with Apache 2.0.52.

    i'm getting the following errors:
    Warning: shell_exec(): Cannot execute using backquotes in Safe Mode in
    /var/www/html/......
    and
    Warning: fopen(): SAFE MODE Restriction in effect. The script whose uid
    is 500 is not allowed to access /proc/uptime owned by uid 0 in
    /var/www/html/xxx.php on line 4

    In my php.ini file, i have
    safe_mode = false
    i tried safe_mode = 0 or OFF, but same problem.

    Anyone can help me plz ?

    Thanks!

  • Ray

    #2
    Re: Safe mode

    Hi

    It seems as though the apache user that was created on your box does not
    have rights to access /proc/uptime.
    Check your permissions on that directory.

    Regards
    Ray

    "zeman" <marckhayat@gma il.com> wrote in message
    news:1118918500 .689031.284030@ f14g2000cwb.goo glegroups.com.. .[color=blue]
    > Hi all,
    > i'm new at PHP.
    > it's running on Linux RedHat, with Apache 2.0.52.
    >
    > i'm getting the following errors:
    > Warning: shell_exec(): Cannot execute using backquotes in Safe Mode in
    > /var/www/html/......
    > and
    > Warning: fopen(): SAFE MODE Restriction in effect. The script whose uid
    > is 500 is not allowed to access /proc/uptime owned by uid 0 in
    > /var/www/html/xxx.php on line 4
    >
    > In my php.ini file, i have
    > safe_mode = false
    > i tried safe_mode = 0 or OFF, but same problem.
    >
    > Anyone can help me plz ?
    >
    > Thanks!
    >[/color]


    Comment

    • zeman

      #3
      Re: Safe mode

      hi ray,
      [root@linux /]# ls -l /proc | grep uptime
      -r--r--r-- 1 root root 0 Jun 16 14:41 uptime

      It has "read" permission of owner, group, and other.
      Apache is running with a user with UID 500.

      Thanks

      Comment

      • Ray

        #4
        Re: Safe mode

        Hi

        Ok, my permissions are set to the same as yours..

        Try using something like this..

        <?

        $strUptime = exec("uptime");

        echo "<pre>";
        echo $strUptime;
        echo "</pre>";

        ?>

        It will return "15:01:35 up 8:52, 6 users, load average: 0.05, 0.16,
        0.09"

        Hope this helps..
        Ray


        "zeman" <marckhayat@gma il.com> wrote in message
        news:1118922510 .889818.24880@f 14g2000cwb.goog legroups.com...[color=blue]
        > hi ray,
        > [root@linux /]# ls -l /proc | grep uptime
        > -r--r--r-- 1 root root 0 Jun 16 14:41 uptime
        >
        > It has "read" permission of owner, group, and other.
        > Apache is running with a user with UID 500.
        >
        > Thanks
        >[/color]


        Comment

        • zeman

          #5
          Re: Safe mode

          well it's not only the uptime that i need, it's other functions.

          if i change the owner of that file to UID 500, it works... but that's
          not a solution.
          i want to solve the safe mode thing.

          Thanks!

          Comment

          Working...