Home » Categories » Multiple Categories

What are the correct file permissions for a PHP file?

Your PHP files should have one of two possible permissions: 644 or 600.

644: If the file is going to be called through your web browser (for example, www.your-domain.com/index.php), it needs to be world-readable. Do not include important passwords or secret API keys in your world-accessible files, as this can provide access for hackers and malicious scripts.

600: If you have PHP files that are not directly accessed through the web browser, and are only referenced in other PHP files, it needs to be only readable by the owner. This is good for include files and files that contain important passwords and API keys.

You can adjust the file permissions in your FTP client or through the File Manager.

To adjust permissions in File Manager:

  1. Log into your eXtend Control Panel
  2. Click ‘File Manager’
  3. Double-click the directories until you are in the one that contains your script
  4. Click on your script
  5. Click on the Padlock icon (Chmod)
  6. Enter in 644 or 600 next to ‘Or enter a mode number’
  7. Click ‘Save’
0 (0)
Article Rating (No Votes)
Rate this article
  • Icon PDFExport to PDF
Related Articles
How do I edit php.ini settings?
Added on Mon, Mar 16, 2015
Can I put PHP code in .html or .htm files?
Added on Mon, Mar 16, 2015
How do I increase the memory allocation for my PHP script?
Added on Mon, Mar 16, 2015
How do I enable MIMEMagic on my account?
Added on Mon, Mar 16, 2015
How do I use short open tags in my PHP scripts?
Added on Mon, Mar 16, 2015