failed to open stream
I bet that it is the issue with permissions. Since you are using sudo to copy, i will assume that it is your home directory that you are copying it from and you've created the file with your user.
There are several ways to resolve this, the quickest would be to make the file world readable. You can do that by running
chmod a+r progma.php
A better way would be to find out what group does the server run under, often that would be group 'web', and then you would do:
chgrp web progma.php && chmod g+r progma.php
Related videos on Youtube
musta
Updated on September 18, 2022Comments
-
musta over 1 year
My problem is that when I send my php file as root to the htdocs directory it appears as this.
root mustafa # sudo cp programa.php /opt/lampp/htdocs/archivos
The php file appears with a big X on top, and when I try to execute it from XAMPP it says:
Warning: Unknown: failed to open stream: Permiso denegado in Unknown on line 0
Fatal error: Unknown: Failed opening required '/opt/lampp/htdocs/Examen/registro.php' (include_path='.:/opt/lampp/lib/php') in Unknown on line 0
-
musta over 10 yearsyour answer is fantasti, I already solve the problem. I just type chmod 755 programa.php from the htdocs directory and it works!! but.. thanks!! a lot anyway :) I dont understand that chmod a+r and chmod g+r and chgrp web, could you share to me a tutorial or something??