Question

I have two servers, one production and one development. Both machines are windows machines, running Apache as the same user on the network. Last week, the network password for the user was changed, and that's when things stopped working.

Ok, no problem, once I identified that happened, I simply change the user/password credentials on the service, and restart Apache.

PHP doesn't want to open any files, or even acknowledge that they exist on the production machine. But everything is dandy on the dev machine.

For illustrative purposes, The following works fine on the development server, but not the production server:

<HTML>
<?php
$filename = '\\\\petra\\operations\\test.txt';
if (file_exists($filename)) {
    echo "The file <u>$filename</u> exists";
} else {
    echo "The file <u>$filename</u> does <b>not</b> exist";
}
?>
</HTML>

On the dev machine, I get a lovely The file \\petra\operations\test.txt exists but on my production machine, i get much less happy The file \\petra\operations\test.txt does not exist I can point to any file on any server on the network and the same will happen.

The hardware is completely different on the two machines, but they are very similar, software wise. For example the Apache configurations and php.ini files are exact copies.

This is related to a previous question I asked. At the time, I was thinking it was a bad file path, or maybe something someone else had made a mess of. That much was true (vis-a-vis, the password changed), but now both machines know the new user credentials and apache has been restarted on both.

Ideas? What would prevent PHP from being able to open a file?

EDIT: I don't think it has to do with user permissions on the files, just as such. Both machines are running Apache as the same user, pointing to the same file on the same network.

I did setup a new test file location on some other random machine on the network, upon which I then set very permissive permissions. my php now calls this: $filename = '\\\\procl35\\folder\\test.txt'; and I get The file \\procl35\folder\test.txt does not exist on the production server.

Was it helpful?

Solution

I have a resolution to this.

First, I should mention the production server is run by the IT department, in the server farm. In the original question above, I stated "I simply change the user/password credentials on the service, and restart Apache." Actually, IT changed the password and restarted Apache. This is a semantic difference, but one which turns out to be important here.

This morning, I asked the people over in IT if they had any ideas on the problem. The sysadmin poked around, and realized he hadn't actually changed the user password at all, despite his insistence that he had done so.

I'm not going to throw IT under the bus here. They're busy people, and they are human, and that's okay. But I will offer this resolution to future developers: If you encounter this kind of problem I suggest "re-updating" the password, because maybe it didn't happen right the first time. Maybe he updated the password on a different service (which also needed it anyway). Maybe he typed it in, mistyped one character, didn't read the failure message, and closed the window. Whatever, it's not important.

The resolution is to update the password in the service.

Cheers!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top