|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
||||
|
||||
|
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-- |
|
#2
|
|||
|
|||
|
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 ...
![]() |
|
#3
|
|||
|
|||
|
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! |
|
#4
|
||||
|
||||
|
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 |
|
#5
|
|||
|
|||
|
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. |
|
#6
|
||||
|
||||
|
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. |
|
#7
|
|||
|
|||
|
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 ![]() |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > aphache/php errors |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|