Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP 5.166 on IIS 6 working - sort of

Status
Not open for further replies.
Feb 2, 2005
54
0
0
US
I am able to view php file that shows me the entire PHP configuration so I know that PHP is installed properly and php files are being sent to the php5isapi.dll on an IIS 6 2003 server.

I have some other php pages that collect information on a form and then write it to a text file. Simple enough. It works on my local computer that is running apache so I know the php code is fine but I never get the text file contents at all when I run it on the IIS 6 box. I also have an echo command that doesn't seem to be processed either.

I'm sure it is a security configuration issue but I'm stuck...any ideas?
 
Yes

<?php

// Show all information, defaults to INFO_ALL

phpinfo();

?>

works just fine and show all the php information

BUT

<?php

$my_data = "This is the data to be stored in the text file.";

// Open the file and erase the contents if any
$fp = fopen("test.txt", "w");

// Write the data to the file
fwrite($fp, $my_data);

// Close the file
fclose($fp);

?>

doesn't produce the test.txt file.
 
If there was a problem writing to the filesystem, PHP should have produced an error.

What are you php.ini settings for "display_errors" and "error_reporting"? Until my machine goes into production, I would edit my php.ini file so that the setting "display_errors" is "on" and the setting "error_reporting" to "E_ALL".

But in general, it's probably because the userid as which your web server runs does not have permission to write to that place on the filesystem.



Want the best answers? Ask the best questions! TANSTAAFL!
 
I have the settings as you describe but do not get an error message.

I believe that IIS uses IUSR_COMPUTERNAME as the account and that account has been given permission to write to the folder within security.
 
Were the settings like that originally, or did you just now edit the file? If you edited the file just now, did you restart IIS afterward?



Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top