0

Consider: I have a file called test.php. Here is the contents:

<?php 
    echo "Hello World"; 
?>

I have ensured my doc root has permissions as per Correct owner/group/permissions for Apache 2 site files/folders under Mac OS X?

When I try to run the above script on my MAMP stack I get this warning:

Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0

Could someone shed some light on my error here please?

Edit: I have tried the ideas below - thank you to @Shozabjaveed - but these have not worked.

Steve Cooke
  • 447
  • 1
  • 4
  • 14

1 Answers1

0

Make Sure that the Apache service has read permissions.

chmod 755 test.php

or ran the recursive command to ensure that the Apache service has read permissions.if using MAC

sudo chmod -R 755 ~/foldername
Shozab javeed
  • 232
  • 2
  • 11
  • The permissions in the folder and higher directories are read, write, execute for me, and read, execute for other parties. – Steve Cooke Aug 17 '22 at 11:29