Running PHP script containing bashscript commands through apache server throws error.

Solution Unverified - Updated -

Issue

  • Error seen in the Apache logs :
[Mon Mar 05 09:16:17.462974 2018] [:error] [pid 18239] [client 127.0.0.1:57450] PHP Warning:  chdir(): Permission denied (errno 13) in /var/www/html/test111.php on line 8
sh: /root/Desktop/block.sh: Permission denied
[Mon Mar 05 09:35:53.816478 2018] [:error] [pid 18153] [client 127.0.0.1:58110] PHP Warning:  fopen(/root/Desktop/fileopen11.txt): failed to open stream: Permission denied in /var/www/html/test111.php on line 10

Environment

  • Red Hat Enterprise Linux
    • 6.x, 7.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.