Finally fixed a problem where the php scipt wont be able to write in my linux server.

So i have created another backup server for my LAMP stack server. Unfortunately, the php script was not able to written anything to the server.

I first did the change ownership way:

chown mlin:apache -R ./nexbd

chown is the program for change ownership, -R is the parameter where it will recurvesly pass the command itself to all folder under the folder named ./nexbd

After that, i also did:

chomod 0777 -R ./nexbd

chmod is the command for change the permission on a file or folder. -R again is the parameter to pass the command to folder underneath of the folders.

After all, no matter what ownership or user i changed to, it just wont work. The program itself just keep saying unable to written to the folder blah blah.

After pulling my hair for a whole morning, i finally noticed that LINUX’s alert that one program httpd is trying to write files and it has been prevented by the SELINUX…

So, i did the following to allow httpd to unified.

“sudo setsebool -P httpd_unified 1”