LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-13-2004, 05:55 PM   #1
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 443

Rep: Reputation: 30
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
 
Old 11-13-2004, 10:19 PM   #2
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
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
 
Old 11-13-2004, 10:32 PM   #3
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 443

Original Poster
Rep: Reputation: 30
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

Last edited by djgerbavore; 11-13-2004 at 11:02 PM.
 
Old 11-13-2004, 10:38 PM   #4
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
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
 
Old 11-13-2004, 11:03 PM   #5
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 443

Original Poster
Rep: Reputation: 30
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

Last edited by djgerbavore; 11-13-2004 at 11:10 PM.
 
Old 11-13-2004, 11:08 PM   #6
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
hey did that sort ut ur problem??

regards
 
Old 11-13-2004, 11:11 PM   #7
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 443

Original Poster
Rep: Reputation: 30
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
 
Old 11-13-2004, 11:26 PM   #8
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
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
 
Old 11-15-2004, 12:15 AM   #9
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 443

Original Poster
Rep: Reputation: 30
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
 
Old 11-15-2004, 01:15 AM   #10
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
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
 
Old 11-15-2004, 06:46 AM   #11
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 443

Original Poster
Rep: Reputation: 30
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
 
Old 11-15-2004, 07:35 AM   #12
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
gooooddd!!
i too have a great feeling that it worked for u now!!

by the way where is PA??

regards
 
Old 11-15-2004, 02:01 PM   #13
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 443

Original Poster
Rep: Reputation: 30
pa is in usa , pennslyavia
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
apache config files and php waynejkruse10 Linux - Software 8 12-05-2006 09:40 PM
Apache 2, PHP 5, SuSE 9.2 - cannot run php files dickohead Linux - Networking 6 06-28-2006 10:25 AM
php files errors on apache - sometimes amimusa Debian 1 04-07-2005 12:52 PM
running apache/php files limp Programming 3 11-07-2004 08:10 PM
apache not able to recognize php files phamtranquocvie Linux - Newbie 2 10-06-2004 11:32 AM


All times are GMT -5. The time now is 07:37 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration