“cd: 1: can’t cd to ~”
02 April 2012 | By Ian in Development, PHP | No Comments Yet
Are you seeing messages like the following in your web server’s error logs?
cd: 1: can't cd to ~
cd: 1: can't cd to ~
cd: 1: can't cd to ~
cd: 1: can't cd to ~
Though it lacks a timestamp, the reason for the error is somewhat self-explanitory–somewhere there is code trying to execute the command “cd ~”. However, the source may be hard to track down. If you’re using the AWS SDK for PHP, I have your answer:
You haven’t created the config file config.inc.php either in the root directory for the SDK (/usr/share/php/AWSSDKforPHP/ on Ubuntu if installed from PEAR) or in your home directory. The file sdk.class.php looks in the SDK root folder for the config file. If it isn’t found there, it checks for $_ENV['HOME'] and $_SERVER['HOME']. If neither of those variables are set, it tries to execute the command “cd ~ && pwd”. Of course, there’s a very good chance the apache user won’t have a home directory, so this command will fail.
The fix is simple: Create the config file or at least create an empty file that it can open up and be done with.
In our environment, the config file is not desirable because we populate all of the required variables through our built-in site config. I just ran “touch /usr/share/php/AWSSDKforPHP/config.inc.php” and the problem went away.
Note: This information is valid as of SDK version 1.5.3 in April 2012.




Last weekend Washington state just upped its liquor prices an average of 13% per bottle in a bid to help fill its 6 billion dollar budget gap. The estimated proceeds from the increase in liquor tax should cover about 1.3% of the budget shortfall. The problem is, I don’t think they will take in nearly as much as they have estimated.
This morning I received a call from a gent with a Boston accent. He indicated that he represents a firm that is displeased with some data I’m using on isnoop.net. According to the caller, my
As with most of my