13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Opening a File<br />

65<br />

Remember that the domain names in your URL are not case sensitive, but the path<br />

<strong>and</strong> filename might be.<br />

Addressing Problems Opening Files<br />

An error you might make is trying to open a file you don’t have permission to read from<br />

or write to. (This error occurs commonly on Unix-like operating systems, but you may<br />

also see it occasionally under Windows.) When you do, <strong>PHP</strong> gives you a warning similar<br />

to the one shown in Figure 2.2.<br />

Figure 2.2<br />

<strong>PHP</strong> specifically warns you when a file can’t be opened.<br />

If you receive this error, you need to make sure that the user under which the script<br />

runs has permission to access the file you are trying to use. Depending on how your<br />

server is set up, the script might be running as the web server user or as the owner of<br />

the directory where the script is located.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!