I've a Centos Linux 6.5 server. If in the root (/home/wwwuser/) of this server I execute phpinfo.php, I notice that under "environment" PWD is set to /home/wwwuser/test/. I tried to rename that folder in test1, and the PWD was still set to that folder.

From what I read on google, this variable should return the current directory. So why if I execute it in the root it returns a subdirectory, even if it's a non-existing directory?

PHP Version 5.3.3 phpinfo.php code:


// Show all information, defaults to INFO_ALL

  • 1
    As is, answering this question is very difficult. Please provide more details about how the script is invoked (exact command line, naturally), its contents, versions of CentOS, PHP and any other components involved. – Daniel B Dec 31 '14 at 12:51
  • Could you post the code? – xR34P3Rx Dec 31 '14 at 23:46
  • @DanielB @ xR34P3Rx: I've added informations in the first post. Please note that wordpress in installed both in root and in "test" folder. – testermaster Jan 1 '15 at 10:01
  • Sounds like enviroment problem. Login on the server as root. Find out what user your httpd server application is running under typing lsof -i :80 in termal will usually display what user http server is running under if service is running on port 80. Then in terminal type su - http_user_name_here then after you login with that command type echo $HOME If it prints out /wwwuser/test/ then that users home directory is not set correctly. – Tim Jonas Jan 1 '15 at 10:57
  • @TimWilliams thanks for your reply. httpds user is apache, but I can't executed "su - apache" because it says "this account is not currently available". From my webmin panel, apache home directory is set to "/var/www/", a different directory from "/home/wwwuser/", which is the real home directory of the server. – testermaster Jan 1 '15 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.