From the course: PHP Techniques: Working with Files and Directories
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
File permissions - PHP Tutorial
From the course: PHP Techniques: Working with Files and Directories
File permissions
- [Instructor] Before we continue learning about how to work with files in PHP, we need to pause for a moment and learn a bit about file permissions. Frankly, file permissions can be a little bit of a hassle, but it's important to understand them so that they don't get in our way. Files and directories belong to a particular user, and the web server is often a different user than the user that owns a file or directory. Permissions on files and directories determine who can have access to them. You cannot read to a file without having file permissions and you also cannot create or delete a file without directory permissions. So if the permissions aren't set right, they can prevent us from reading or writing a file using PHP. Further complicating matters, setting permissions varies by operating system. If you're using Windows via the graphic user interface, you can go to a file, choose Properties, choose the Security tab,…
Contents
-
-
-
(Locked)
Filesystem basics6m 6s
-
Relative paths and magic constants4m 53s
-
(Locked)
Accessing files5m 4s
-
(Locked)
Reading from files4m 52s
-
(Locked)
Reading line by line5m 9s
-
(Locked)
File permissions5m 34s
-
(Locked)
Writing to files5m 5s
-
(Locked)
Writing line returns2m 28s
-
(Locked)
Deleting files2m 38s
-
(Locked)
Moving the file pointer7m 36s
-
(Locked)
Examining file details6m 52s
-
(Locked)
Challenge: Create a log file2m 2s
-
(Locked)
Solution: Create a log file3m 17s
-
(Locked)
-
-
-