LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-02-2005, 12:07 PM   #1
Die Woud
Member
 
Registered: Apr 2005
Distribution: Fedora
Posts: 33

Rep: Reputation: 15
PHP and apache


Im trying to run a apache webserver with php support, now i installed them both, and they seem to be running. the php work when i use phpinfo() so that seems ok. but the issue arrives when i try to create a file that needs to write. like a counter that needs to write +1 to a txt file. first i thought it was my software, but then i tried it with notepad aswell, still does not work. the counter displays and gives a value of 1, but does not increase, it cannot write to the txt file. then i thought it was the code, but i used that exact same code on a friends server, and it worked. so now, the only thing that remains is the apache server. im running apache from my linux machine but use windows to develop the pages. if someone could give me some advice pls...?
 
Old 11-02-2005, 12:36 PM   #2
narc
Member
 
Registered: Aug 2004
Location: Montréal
Distribution: Linux from scratch
Posts: 68

Rep: Reputation: 15
Re: PHP and apache

Quote:
Originally posted by Die Woud
Im trying to run a apache webserver with php support, now i installed them both, and they seem to be running. the php work when i use phpinfo() so that seems ok.
So far, so good.

Quote:
but the issue arrives when i try to create a file that needs to write. like a counter that needs to write +1 to a txt file. first i thought it was my software, but then i tried it with notepad aswell, still does not work. the counter displays and gives a value of 1, but does not increase, it cannot write to the txt file. then i thought it was the code, but i used that exact same code on a friends server, and it worked. so now, the only thing that remains is the apache server. im running apache from my linux machine but use windows to develop the pages. if someone could give me some advice pls...?
OK. I believe it is a permission issue. You web servcer runs under a certain username, like wwwrun, or apache, or some other name. The file you are trying to write probably doesn't have the proprer permissions since it might have been written under you own user name or root, and only that user is allowed to write on this file.

Now I won't address any specifics about file permissions on Linux since it's a topic on its own, so I'll let you do your homework on how to set them up, etc. In the meantime, setting you text file with 'chmod 777 <my_text_file>' usually fixes many similar problems. BUT ... it would be wise to think of other stragtegies like using directory locks or databases if you want to make your site public and avoid the security pitfalls such solution will eventualy cause.

Good luck.

narc.
 
Old 11-02-2005, 12:47 PM   #3
Die Woud
Member
 
Registered: Apr 2005
Distribution: Fedora
Posts: 33

Original Poster
Rep: Reputation: 15
damn im gonna cry, is there perhaps a nice tutorial on file permissions somewhere. becuase im having username and permission errors with mysql aswell
 
Old 11-02-2005, 02:50 PM   #4
narc
Member
 
Registered: Aug 2004
Location: Montréal
Distribution: Linux from scratch
Posts: 68

Rep: Reputation: 15
When I type: "Linux file permissions tutorial" on Google, I get many hits ;-)

Try this one: http://www.hostingmanual.net/other/permissions.shtml

Maybe a more complete reference on administering your system would be more helpful with this link:
http://linux.about.com/od/embedded/l/blnewbie_toc.htm

MySQL's persmissions can be tricky, depending on the problem you have: it has its own set of permissions and user management for accessing data on top of the basic Unix/Linux file-system. If you have a MySQL question or trouble configuring it, redirect your questions to a MySQL-related forum. Take some time to read the manual
(http://dev.mysql.com/doc/refman/4.1/en/index.html).

Good luck.

narc.
 
  


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 2, PHP 5, SuSE 9.2 - cannot run php files dickohead Linux - Networking 6 06-28-2006 10:25 AM
php apache or php cgi - php learner rblampain Linux - Security 3 12-17-2004 11:10 PM
slackware, apache and PHP from .tgz - problems with PHP szymon Slackware 2 09-06-2004 04:57 PM
reinstalled apache, php, still no php support SuSE 8.2 hindenbergbaby Linux - Software 1 10-14-2003 01:42 PM
php-nuke with apache php mysql c0c0deuz Linux - Software 0 03-30-2003 06:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:24 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration