sigmadog Posted August 25, 2009 Share Posted August 25, 2009 I've built a script for a client's web site that works great when I test it on the Linux/Apache server on my web site, but it won't work on their site, which, according to the phpinfo() script, is Windows NT ST3-WEBHOST 5.2 build 3790 using ISAPI server API. The script takes input from a form and writes it to a text file for use as an include in other pages. Having a little experience building php on Apache, and absolutely none on NT, I'm sure I goofed up somewhere. Error detection has indicated some sort of permissions problem having to do with the difference between Apache files and NT files, but I can't figure it out. Here is my script below. Is there anything obvious that needs to be changed for the WINDOWS NT server? ========================================== <?php if (isset($_POST[submit])) { $alertFile = "inc/inc_alerts.php"; $Open = fopen ($alertFile, "w"); $redStatus = $_POST['redRouteStatus']; $blueStatus = $_POST['blueRouteStatus']; $greenStatus = $_POST['greenRouteStatus']; $ruralStatus = $_POST['ruralRouteStatus']; $linkStatus = $_POST['linkRouteStatus']; if ($Open) { fwrite ($Open, "<?php\n\t\$routeRed = \"$redStatus\";\n\t\$routeBlue = \"$blueStatus\";\n\t\$routeGreen = \"$greenStatus\";\n\t\$routeRural = \"$ruralStatus\";\n\t\$routeLink = \"$linkStatus\";\n?>"); fclose ($Open); $Worked = TRUE; echo ("<p>The form was successfully processed.</p>\r\n<p><a href=\"alerts_admin.php\" target=\"_self\">Click here</a> to refresh the page with the new information.</p>"); } else { $Worked = FALSE; echo ("<p>System error. Please try again. Contact webmaster if problems continue.</p>"); } } ?> ===================================================== Thanks for any help. Quote Link to comment Share on other sites More sharing options...
Mardoxx Posted August 25, 2009 Share Posted August 25, 2009 try $alertFile = "z:\\directory_to_your_www\\public_html\\inc\\inc_alerts.php"; Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted August 25, 2009 Share Posted August 25, 2009 It would really help if you posted the actual error message. If the error actually is due to a permissions problem, the folder where the file is located probably does not have the necessary permissions for the USER that the web server/php is running as. Quote Link to comment Share on other sites More sharing options...
Mardoxx Posted August 25, 2009 Share Posted August 25, 2009 "Error detection has indicated some sort of permissions problem having to do with the difference between Apache files and NT files" oh, didn't read that... just set the properties on your NT box to READ WRITE EXECUTE to everyone not like it'd make much difference to security (lol) Quote Link to comment Share on other sites More sharing options...
sigmadog Posted August 25, 2009 Author Share Posted August 25, 2009 Thanks for the quick responses. As a follow up, here is the error message: Warning: fopen(inc/inc_alerts.php) [function.fopen]: failed to open stream: Permission denied in D:\SERVERNAME\www\new\alerts_admin.php on line 54 Line 54 is: $Open = fopen ($alertFile, "w"); It appears that the server settings will not allow me to modify file permissions. I tried to change the permissions of "inc_alerts.php" to 777 (via ftp client) but it didn't change. They remain at 666 (though I thought that would work). So it looks like I need to contact the server administrator and have them change the permissions for me. Is that the solution, or am I missing something? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted August 25, 2009 Share Posted August 25, 2009 Under Windows, you have to change the permissions on the server. You might have the ability to do this through your hosting control panel or if you create the folder through your hosting control panel rather than through your ftp client/upload. Quote Link to comment Share on other sites More sharing options...
sigmadog Posted August 25, 2009 Author Share Posted August 25, 2009 Under Windows, you have to change the permissions on the server. You might have the ability to do this through your hosting control panel or if you create the folder through your hosting control panel rather than through your ftp client/upload. Yeah, that's what I figured. Unfortunately, I'm doing this project for a client who doesn't know the first thing about this stuff (makes me feel like a friggin' genius), and doesn't have any login info for the control panel. I'm waiting to hear from someone else in the organization who might be able to track this stuff down. Thanks for your help. I consider this problem solved for all practical purposes. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.