The important thing is that the user that uses your server (which executes the php interpreter) has the permissions to access those files. now if you use apache2 usually said users is www-data
so first what you need to do is change the group of files.
sudo chown -R :www-data OPT/LAMPP/HTDOCS/PAGINA
here what we are doing is that the files of the page belong to the group www-data
. Now, as the php myadmin tells you with 777 permissions you are telling the computer that these files can be read, written and executed by anyone (total disaster) so you must change to a permission format where only the owner of the files or members of the same group can edit them. for this we do
sudo chmod -R 774 OPT/LAMPP/HTDOCS/PAGINA
There we are giving total permissions to both the owner of the file (the first 7), the group of files (in this cases www-data
, with the second 7) and 4 indicates that the rest of the users only have Read permission. Here your application should work well. but in some cases the group should not have all the privileges either.
To clarify the permissions I recommend you read this document wikipedia
Octal notation
Another very common way to represent Unix permissions is the notation
octal, which consists of a value of three or four digits in base 8.
With the three-digit octal notation, each number represents a
different component of the permission set: user class, class
of group and class of the rest respectively.
Each of these digits is the sum of the bits that make it up
(see also binary numbering system). The weight of each bit in
one digit is as follows:
El bit de lectura suma 4 al total.
El bit de escritura suma 2 al total.
El bit de ejecución suma 1 al total.
These values never produce an ambiguous combination: every sum
Represents a specific set of permissions.
Here are the examples in the symbolic notation section above in
its octal notation:
"-rwxr-xr-x" se representa como 755 en notación octal de tres dígitos.
"-rw-rw-r--" se representa como 664 en notación octal de tres dígitos.
"-r-x------" se representa como 500 en notación octal de tres dígitos.