FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Do you know any useful way ?





shamil
I have a script file on linux web server which must copy the file X to another location when executed. But when i execute the file from client machine it says
Code:
Warning: copy(img/aa.txt) [function.copy]: failed to open stream: Permission denied in /usr/local/apache/htdocs/website/copy.php on line 2

Because others don't have write privileges on that location.
Also it is not good idea to give others write privileges.
I can solve this problem with ftp connection but i think it is not logical to open a ftp connection just to say copy file. Rolling Eyes But not sure.
Do you know any useful way to do it?
n0obie4life
CHMOD img folder 777 Wink

As long as you do that, the script can write to that folder.
shamil
n0obie4life wrote:
CHMOD img folder 777 Wink

As long as you do that, the script can write to that folder.


It is true but they say it is not good idea to give write priveleges to others on files or folders and doing so makes others to easily manage those files from web.
SirDuncan
hi,
instead of chmod 777 you can change the group of the img folder to the group that owns the webserver process, and give write permissions only for
that group, not for everybody (777)
virtualpointer
[quote="shamil"]I have a script file on linux web server which must copy the file X to another location when executed. But when i execute the file from client machine it says [code]Warning: copy(img/aa.txt) [function.copy]: failed to open stream: Permission denied in /usr/local/apache/htdocs/website/copy.php on line 2[/code]
Because others don't have write privileges on that location.
Also it is not good idea to give others write privileges.
I can solve this problem with ftp connection but i think it is not logical to open a ftp connection just to say copy file. Rolling Eyes But not sure.
Do you know any useful way to do it?[/quote]

I am so curious about your question, do you mean your script must copy a file to a location without a write permission? You have no permission, how can you write?

Yes, you can copy file with FTP, because you have write permission. But your script will be used by clients.

My opinion is: if your script does need to write something somewhere, just give write permission to some specified directory, then write a program to manage this directory.
Aredon
The permissions 755 would be better.
Dentist-t
Hi Shamil I am from Azerbaijan too . My name is Togrul AND i am proud of that Azerbaijanians visit this site - it is a great progress.
Sorry i can't help you with your question ,but i know a lot of things about computers . You can ask me any questions, i will be happy to help.
I want to ask you something . As you know i am new in this site and i don't know how to earn points What i must do to earn more points? Must i continue earning points after getting frihost? I hope you will anser.
shamil
Dentist-t wrote:
Hi Shamil I am from Azerbaijan too . My name is Togrul AND i am proud of that Azerbaijanians visit this site - it is a great progress.
Sorry i can't help you with your question ,but i know a lot of things about computers . You can ask me any questions, i will be happy to help.
I want to ask you something . As you know i am new in this site and i don't know how to earn points What i must do to earn more points? Must i continue earning points after getting frihost? I hope you will anser.


To earn more points you have to be active in forums. Every day, 1 Point is deducted from all hosted members. If you want hosting you must continue being active in forums. You can find everything you wonder here http://www.frihost.com/faq.php
Related topics
*OFFICIAL* Which Browser do you use?
A Useful Javascript
Free Stock photo site | useful |
Gimp - Cutting out renders
Most useful topics to new forum
30Gb of e-mail space. Insane
Which scripts are the most useful to learn?
CSS/HTML
Hover Buttons Completely with CSS
Useful run commands
Dreamweaver, Flash, Firefox..
Some useful DHTML/AJAX scripts
JavaScript useful links
how to avoid getting banned
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.