从绝对路径下载文件

I am trying to download a file from an absolute path, but I can't get it to work. What am I doing wrong?

$fileurl = '/home/mydomain/public_html/wp-content/uploads/312tekstsecure3.pdf';
header("Content-type:application/pdf");
header('Content-Disposition: attachment; filename=' . $fileurl);
readfile( $fileurl );

You need to change just one line.

<?php 
$fileurl = 'yourpath/file.pdf';
header("Content-type:application/pdf");
header('Content-Disposition: attachment; filename=' . $fileurl);
readfile( $fileurl );
?>

It should be

readfile($fileurl)

Are you sure that the file exists and the server has correct access rights to this file? What about Content-Length header?