Chapter 23. Working with the Filesystem

This chapter contains information on the multiplicity of system functions built into PHP. Many of these functions duplicate system functions via HTTP. Among the most useful are file-reading and -writing functions and those that return dates or times.

Warning

Many of the functions in this chapter have serious security implications. You are inviting bad news if you use them without thinking pretty hard about the consequences! We'll try to point out the scariest ones as we go, but nothing that allows the system to be altered via HTTP should be undertaken lightly.

Some of these functions are Unix-only. The Windows system is deliberately made less available to users, especially to non-administrator users, and lacks many utilities that Unix-heads take for granted. If you're having problems and you run on Windows, make sure the function is enabled on your platform.

Understanding PHP File Permissions

Many PHP users, who have a developer orientation rather than any sysadmin experience, unfortunately do not take the time to understand Unix filesystem permissions. You really need to have a firm grasp of the basics to make good decisions about using many of the functions in this section. If you already do, feel free to skip the rest of this section.

Unfortunately, most explanations ...

Get PHP6 and MySQL® 6 Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.