This problem is common with linux distros such as Linux Mint, Ubuntu, Kali Linux and others. The error appear when you try to execute code within /opt file and other dedicated folders or copy and moving files.
The error read “failed to open stream: Permission denied in /opt/lampp/..”, or File permission denied on /opt/lampp… when you try to copy or moving file, it persist until you change file permission value.
With this article I’m going to share with you step on how to set permission that will allow xampp files to execute actions such as delete, write and overwrite.
In Linux, only root users have permission for executing any command, thus make folders not writable for others.
Since htdocs on xampp is owned by root user within /opt file, then all commands from other users can be denied that’s why I’m going to show with you on how to fix it.
Here are the steps on how to fix error: failed to open stream: Permission denied in /opt/lampp/htdocs..,
1. Open terminal with root access or run default terminal then run following codes to enter into root module; sudo su
2. Change permission for htdocs folder and all files inside that folder by changing chmod to 777 by running the following code; sudo chmod -R 777 /opt/lampp/htdocs/
3. Done.