Development Workflow

Match Local File Permissions and Case Sensitivity to Production

Find filesystem assumptions locally before deployment by checking writable paths, filename case and upload handling.

An application that works on a Windows workstation may fail on a Linux host because filesystem permissions and filename case are handled differently. Local development should reveal these assumptions before deployment.

Separate readable code from writable data

Application source should generally be readable by the web process but not broadly writable. Directories for logs, cache, sessions or uploads should be explicitly writable by the relevant process. Avoid making the entire project world-writable to silence permission errors.

Test filename case

Linux filesystems are commonly case-sensitive. A reference to UserProfile.php will not necessarily find userprofile.php. Use consistent naming and run tests in a Linux environment when the production server uses Linux. Git can also have difficulty representing case-only renames on some Windows configurations; perform and verify such changes carefully.

Treat uploads as untrusted data

Validate upload errors, size, extension and detected content type. Generate server-side filenames and store private uploads outside the public document root. If public delivery is required, serve files through a controlled route or a dedicated public storage area with safe response headers.

Reproduce the deployment user

A local development server may run under the developer's account, which has broader filesystem access than the production PHP-FPM user. Use containers or a Linux staging environment to test ownership, group permissions and read/write behavior realistically.

Diagnose without weakening security

Inspect the process user, directory ownership and effective permissions. Grant only the access needed for the specific path. Avoid blanket chmod 777 fixes and ensure backup or temporary files are not publicly accessible.

Further reading

Share this page Help other developers discover this resource.