Facebook has decent documentation. Besides the overall reference mentioned in the comment, start here:
https://developers.facebook.com/docs/php/gettingstarted/ https://developers.facebook.com/docs/php/howto/postwithgraphapi
Be sure to create a Facebook app to get the App ID that you'll need to configure the Facebook object.
The part of the code that does the actual post is this:
$facebook->api('/me/feed', 'POST',
array(
'link' => 'www.example.com',
'message' => 'Posting with the PHP SDK!'
));
I know you mentioned doing this with PHP. I have created similar functionality in a PHP app (post to a user's wall when clicking a button), but I used the Javascript API, so it's invoked client-side. There is similar documentation for the Javascript API by Facebook. Just a thought.
If you are getting specific errors, please post them and you'll get more specific answers.