Page 1 of 1

Chdir not doing anything

Posted: Mon Jan 29, 2007 2:12 pm
by shiznatix
I moved a website from the test server to the live server and now I have some problems.

The problem is that the chdir() command no longer works. I need to step down a dir but doing chdir('../') does nothing. When I var_dump() it, it return bool(false).

Safe mode is Off and im moving to the root directory so there should not be any permission problems. Any idea why this would happen?

Edit: also, the test server is on the same shared host as the live server so I don't see how there could be this strangeness since its the same server configuration.

Posted: Mon Jan 29, 2007 2:22 pm
by feyd
Does the user that PHP runs under have permission to access (read and execute) that directory?

Posted: Mon Jan 29, 2007 2:50 pm
by shiznatix
Yes, the proper permissions are in place.

Posted: Mon Jan 29, 2007 2:55 pm
by feyd
Does getcwd() tell you what you expect (before the call)?

What's important about changing the working directory to that one?

Posted: Mon Jan 29, 2007 3:01 pm
by shiznatix
ya getcwd() makes sence before the call but after the call to chdir() it keeps the same directory.

The thing is I am using a framework thingy that I made and all of the engine and everything are in the root directory. I put the regular index.php files in the root directory and they have access to everything no problem when I use require_once but I put the admin files in /admin and now for those files to use the requires that are built in I need to be in the root directory so I try to just do chdir('../') first thing to get to that dir which usually works perfectly fine but for some reason now I cant do it.

I put up some stupid small fix but its quite hackish and im not a fan.