problem in writing to a file (URGENT)

I need to write to a file however i am not being able to do so. I can create a file and later write to it however when I try to write to an existing file then I am not allowed to. The thing is everything works in localhost ...its when I keep it in the server that the problem starts coming. I believe this has got to do something with the permission so I changed the permission to read,write, execute for all (user/group/other) but then it didnt help. Does anyone have any idea on this ?
Sid123Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

wildzeroCommented:
Change the file permission to 777 OR you may need to change the folder that actually contains the file, try and change that to 777 as well.

Note - 777 is really not a good idea however it IS a quick fix to see if thats the problem.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
wildzeroCommented:
See here about file security (777 permissions)
http://www.experts-exchange.com/Web/Web_Languages/PHP/Q_21789944.html
0
WilliamFrantzCommented:
> when I try to write to an existing file then I am not allowed to.

What do you mean?  Do you see an error message?  What's the message?  How are you writing to the file?  fopen() fwrite()?

> I changed the permission to read,write, execute for all
> (user/group/other) but then it didnt help.

I believe that's what wildzero was suggesting.
How did you change the file permission?
Did you use the PHP chmod() function or did you use the linux 'chmod 777' command?
Who is the owner of the file?
0
ysreCommented:
Although unlink(..)ing a not needed file before writing to it may help.
Of course you'd have to have the right permissions (unless it's a totally esoteric problem created by the server your script / page runs on) ;).

Ys
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.