PHP - Permission needed?

phatcactus

The Ugly Organist
I basically just want PHP to create a new file and throw some stuff in it. I can write to files that already exist with no problem, but I can't get PHP to create a new file. I've tried fopen($TheFile, "w") and touch($TheFile) but they both end up saying I don't have permission. Any ideas? Sorry if this is a little vague. It used to work, but I must've done something recently to break it.

- Brian
 
The owner (me) was the only one with permission to write to the folder I was trying to create files in. Since I realized that PHP is not me, I figured I'd have to give everyone else permission to write. I typed "chmod a+w foldername" into the Terminal and everything's been goin' just dandily since.

I didn't wanna explain what I did because I don't actually know what "chmod a+w" does. I assumed it would allow all (a) to write (w), but that was just a guess. Anybody mind explaining it?

- Brian
 
a+w is append and write [or at least it should be!]

i've been where you are now. using files on the system is a pretty clunky way to do things, though i set myself the task of figuring file access out first before moving onto MySQL

that said, the likes of Google use a file-based database system for all of the searches, all of which are hand-tweeked hourly / daily by their staff .. file access is by far faster than a database search [apparently]

good luck with what you're doing!
 
Yeah, I thought I'd try learning MySQL, so I got a book... wow. It's damn complex, and my simple mind is struggling to make sense of it all. I think storing everything in files is workin' quite well so far, so maybe I won't even need a database. We shall see...

-Brian
 
if you want to make a serious fist of learning MySQL, two books to look out for; Beginning PHP and Learning MySQL, both by Wrox Publishing.

MySQL might look difficult, and i suppose the advanced stuff is, but for the regular CRUD (CReate, Update & Delete) stuff, it's quite intuitive and worth while.

good luck!
 
Problem with me is I can't change the permissions of my root directory :\ not through the online control panel ... Any one using ICDSoft out there?
 
Back
Top