LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   writing files on to apache with php (https://www.linuxquestions.org/questions/programming-9/writing-files-on-to-apache-with-php-254477/)

djgerbavore 11-13-2004 05:55 PM

writing files on to apache with php
 
i have an apache server, and i'm writng php scripts for a website. now i'm trying to create and write to files for my website, however, apache server seem to be not creating the files. i ran my script offline of the server and it created a new file, however when i run it on the server it doesn't create the file. i looked in the httpd.conf wiht no success

thanks
djgerbavore

masand 11-13-2004 10:19 PM

hi
what i think is that apache uses userbane apache to perform all operaion.
that might be hindering it

so try giving more rights to username apacahe or try writing to a diferent directory

regards

djgerbavore 11-13-2004 10:32 PM

i'll try that,

but i'm running apache as root, and my php scripts are creating/writing files to the htdocs directory, so everything is on the server side. do i still need to give rights to my directory?

also i'm a noobie to apache web server. so you been have to point me in the right directions.
thanks,
djgerbavore

masand 11-13-2004 10:38 PM

hi there
thats what i am saying
u r running apache as root user but apache performs all actions w.r.t to user apache

also see ur logs, u will get some erorr msgs in ur webserver logs

regards

djgerbavore 11-13-2004 11:03 PM

thank you,


sorry i'm alittle new to apache web server

you have been alot of help

sorry to brother you, but this i'm trying to meet a deadline,
you mean i need to use hte chmod command, or is there something in the httpd.conf script that i need to look in, sorry i'm not on my linux box right now, so i can't check what the log files say.

thanks

masand 11-13-2004 11:08 PM

hey did that sort ut ur problem??

regards

djgerbavore 11-13-2004 11:11 PM

you have been alot of help

sorry to brother you, but this i'm trying to meet a deadline,
you mean i need to use hte chmod command, or is there something in the httpd.conf script that i need to look in, sorry i'm not on my linux box right now, so i can't check what the log files say.

thanks

masand 11-13-2004 11:26 PM

hi there

no do not bother me at all!!!
i get to learn a lot from all these

well what u can try is assign different permission to ur directory so that the user apache can access that also

regards

djgerbavore 11-15-2004 12:15 AM

i just have one more question, (sorry for being such a newbie), but i don't know how to change apache user permissions.

I look on the web and no success, i tried about thousadn different chown apache /var/www/htdocs/ variation.
but i keep getting a permission deny error in my apache error log. It writes permission deny to open stream(file.dat).

Is there somehting i'm doin wrong...

thank you for help,

djgerbavore

masand 11-15-2004 01:15 AM

hi there

before changing pemissions for user apache
one thing u need to consider is
if u give full permissions to pache then it cvan change a lot of things with out ur permision

so try changing thepermisions of the file that u want to edit

chmod 0777 <name of file with path>

this will make the file
read. write. xecute for all users

try this

regards

djgerbavore 11-15-2004 06:46 AM

you are the best!!!!! chmod 0777 worked. i can read/write files! i'm very happy you have no idea, how good this feels,


i might actually make my deadline now!!!!!

thank so much

djgerbavore

masand 11-15-2004 07:35 AM

gooooddd!!
i too have a great feeling that it worked for u now!!

by the way where is PA??

regards

djgerbavore 11-15-2004 02:01 PM

pa is in usa , pennslyavia


All times are GMT -5. The time now is 03:03 PM.