Find the answer to your Linux question:
Results 1 to 2 of 2

Thread: apache problem

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    apache problem

    ihave problem ,the apache server can not execute some codes from brawser,but the same code executed from terminal.this example
    $text=fread($file, $filesize);
    echo("filesize:$filesize bytes");
    but another codes can executed in the browser. example
    $a=0; $b=0;
    $a+=10; $b+=5;
    echo("at the of the loop a=$a and b=$b");

  2. #2
    1. I doubt you will be able to open /root/Desktop/qu.txt with the apache user. By default the /root directory is accessed only by the root user.

    2. I suggest you put this file in a location readable by apache

    3. What distro are you using? If you are using RHEL, CentOS or Fedora, they come by SELinux enforced by default. This means that unless your file is in the httpd_sys_content_t context, you'll unlikely be able to read it.

    If that is the case as well you must as well execute:

    chcon -t httpd_sys_content_t /var/www/html/qu.txt
    If qu.txt is in /var/www/html of course

Posting Permissions

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