Q12: How do I keep my scripts secure?

Answer

Follow these security best practices:

  1. Use latest versions: Keep scripts updated with security patches
  2. Proper permissions:
    • Scripts: 755 (not 777)
    • Data files: 644 or 666 only if needed
  3. Configure referers: Limit which domains can access your scripts
  4. Validate input: Don't trust user-submitted data
  5. Protect data files: Store them outside the web root if possible
  6. Use .htaccess: Restrict access to sensitive directories
Warning: Never set permissions to 777. This is a major security risk.
Previous General FAQ