I am using Facebook SDK to post some test wall post on my own facebook page. It works fine when i run the script on my browser but when i run it from terminal it gives me as err
If you run your script from a terminal, or a cron job, there is no HTTP environment.
A possible solution to this is to run the script with a wget http://.../parameters instead of with php scriptname.
wget http://.../parameters
php scriptname