getcwd cannot access parent directoresエラー解決方法



[root@web-server php]# /etc/init.d/httpd restart
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
このエラーは、getcwdコマンドが現在の作業ディレクトリに位置決めできないことを示しています。一般的には、cdがあるディレクトリに着いたら、このディレクトリをrmします。この時にいくつかのserviceスクリプトを実行すると、getcwdエラーが発生します。cdから実際に存在する任意のディレクトリの下でコマンドを実行すればいいです。