PHP上传进度条和PHP版本?

I'm trying on a project, that i need to create a progress bar while uploading some file with php.

I find this example;

http://www.johnboy.com/php-upload-progress-bar/

But the progress bar is not working in my PHP 5.4 local server, or any my internet server that PHP5.4 too.

I have knowladge about the bar building like width: x% but i cant get the progress variable.

Is there any code that i can check the file's uploaded size, while i'm uploading it?

theCurrentUploadedSize($_FILES["thefile"]);

or like

theCurrentSize("path/to/thefile/whileuploading");

Any help or link might help me, i dont have any knowladge about file management with php.

-----------Solved-----------------

The problem was about the APC add-on for the PHP. If you have such problem, look for how to install Alternative PHP Cache Add-on.

have you had a look at the upload progress functionallit built into PHP since 5.4?

There is a good description at http://oliversmith.io/technology/2011/12/04/php-5-4-file-upload-progress-and.html5-progress-bars/