Thanks for the replay. I compared them: PWD in shell is /root, with php is the document root of my site. HOME in shell is /root, with php is /var/www PATH in shell is /usr/lib/kde4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin but in php it is /sbin:/usr/sbin:/bin:/usr/bin Another vairable in shell is: _=/usr/bin/env in php: _=/etc/init.d/php-fastcgi Should I change these for php and how? and how to set them b ack after I ran the program?