ihave problem ,the apache server can not execute some codes from brawser,but the same code executed from terminal.this example
but another codes can executed in the browser. example
echo("at the of the loop a=$a and b=$b");
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:
If qu.txt is in /var/www/html of course
chcon -t httpd_sys_content_t /var/www/html/qu.txt