1

Today I accidentally gave write permission to my index.php file to using sudo chmod +x index.php. I don't know what permission it had before.

My index.php contains a php script for collecting number of visitors and an another script for collecting referrer links. It also contains some pictures and css code and my webserver is Lighttpd

Did I made a mistake by giving index.php that permission? Can my website be hacked for it?

  • If hacker will able to reach till index.php then changing permission is not a big task for hacker. show your code contains a php script for collecting number of visitors and an another script for collecting referrer links. Generally Keeping permission 0644 is safe. Only Owner can write – Rasa Mohamed Jun 1 at 9:12
  • 1
    Questions about programming are off topic here. You should delete this and, instead, ask on stackoverflow.com webmasters.stackexchange.com/help/on-topic – Rob Jun 1 at 11:53
  • How are file permissions programming? If this were asked on SO, I think it would get closed it because there is no code involved. SO does have a relevant question for 2010 though: What permissions for PHP scripts/directories? – Stephen Ostermiller Jun 3 at 16:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.