Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-02-2005, 12:07 PM
|
#1
|
Member
Registered: Apr 2005
Distribution: Fedora
Posts: 33
Rep:
|
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...?
|
|
|
11-02-2005, 12:36 PM
|
#2
|
Member
Registered: Aug 2004
Location: Montréal
Distribution: Linux from scratch
Posts: 68
Rep:
|
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.
|
|
|
11-02-2005, 12:47 PM
|
#3
|
Member
Registered: Apr 2005
Distribution: Fedora
Posts: 33
Original Poster
Rep:
|
damn im gonna cry, is there perhaps a nice tutorial on file permissions somewhere. becuase im having username and permission errors with mysql aswell
|
|
|
11-02-2005, 02:50 PM
|
#4
|
Member
Registered: Aug 2004
Location: Montréal
Distribution: Linux from scratch
Posts: 68
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 11:24 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|