Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old April 19th, 2001, 12:27 AM
caguru's Avatar
caguru caguru is offline
<insert title here>
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Location: at home
Posts: 405 caguru User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 29 m 59 sec
Reputation Power: 8
Okay, this is driving me crazy. I cannot get my sript rewrite files to work. I have torn everything out to the basics to see what the deal is. Still can't get it. On my w2k machine w/apache and php4 this works fine. On my web server Linux/apache/PHP3 this gets plenty of errors.

the script======================

<?
$newfile = fopen ("c:\server\output.html", "w");
fwrite($newfile, "TEST");
fclose($newfile);
echo"finito";
?>

web server error================

Warning: fopen("/home/user/serverroot/test_write.html","w") - No such file or directory in /home/user/serverroot/update/write_data.php on line 2

Warning: Supplied argument is not a valid File-Handle resource in /home/user/serverroot/update/write_data.php on line 3

Warning: Supplied argument is not a valid File-Handle resource in /home/user/serverroot/update/write_data.php on line 4

finito

the details================

the file that contains this script is in the update folder that is password protected. I am trying to write to the public server root directory.

my headache============
got some extra tylenol?

if i can provide more info let me know, thanks all!
__________________
--the key to life is avoiding death--

Reply With Quote
  #2  
Old April 19th, 2001, 08:47 AM
dihjital dihjital is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Posts: 31 dihjital User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
check permissions

If you are using the module version of PHP on the Linux box, make sure that the server process has adaquate access to the file you are trying to read from or write to. Don't forget to check the directory permissions as well ...

Reply With Quote
  #3  
Old April 23rd, 2001, 05:38 PM
tlthomas tlthomas is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Location: Idaho
Posts: 46 tlthomas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to tlthomas
I'm still new to this but shouldn't this line read different

$newfile = fopen ("c:\server\output.html", "w");

$newfile = fopen ("output.html", "w");

maybe?
terry
__________________
It works better if you plug it in!

Reply With Quote
  #4  
Old April 23rd, 2001, 06:52 PM
caguru's Avatar
caguru caguru is offline
<insert title here>
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Location: at home
Posts: 405 caguru User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 29 m 59 sec
Reputation Power: 8
figured it out, kinda

turns out I have no problem running this script if i set the file mode to 777. According to my web host this is totally safe. They said only people on the network could mess with the files, and that all accessing via http would not.

I am not that sure though. I wouldn't know you to tamper with a web server via http but that's saying a whole lot.

Thanks for the help guys and I have one more question. Will setting permissions to 777 on linux allow someone to change the files through apache http server?

thanks again

Reply With Quote
  #5  
Old April 24th, 2001, 02:25 AM
dihjital dihjital is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Posts: 31 dihjital User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
absolutelly

777 means that EVERYONE got access to your files. That means the webserver as well. Therefore if someone succeeds to upload a script to your server then he can overwrite any of your files which have 777 permission.

I reccommend you to go through this issue with your ISP again and try to find a better solution cause setting file permissions to 777 can be a security breach.

Reply With Quote
  #6  
Old April 24th, 2001, 12:34 PM
caguru's Avatar
caguru caguru is offline
<insert title here>
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Location: at home
Posts: 405 caguru User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 29 m 59 sec
Reputation Power: 8
That's what I thought. I knew they were idiots. Kinda funny they don't a whole lot about apache/linux when they supposedly host a few hundred thousand sites.

Thanks for the info and I will find a solution before I unlock that directory.

Reply With Quote
  #7  
Old April 26th, 2001, 06:55 AM
Technocrat Technocrat is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Posts: 3 Technocrat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
777 is definately a bad idea... worldwritable files in webspace... might as well put a sign up: "put a script here and hack my box"

Try 755 for dirs and 644 for files if you need world readable... might cure it

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > aphache/php errors


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway