How would I got about calling a php file every time someone publishes a new post?

add_action('publish_post', 'call_my_php_file');
function call_my_php_file($post_id){
  require_once("path/to/file.php");
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)