Problem playing large video files with xmoov.php
If you are playing long videos – like more than 20 minutes or so – using xmoov.php then you may notice a small problem, such as the videos not playing. If so then the solution is very simple. You just need to increase the amount of memory that PHP can access.
I’m using WAMP and by default the PHP.ini file gives it 128MB to work with. I upped that to 1028MB and now I can play videos that are in the 90 minute range.
In WAMP you can change the memory limit by opening the PHP.ini file – locate it by clicking on the WAMP server icon in the system tray -> PHP -> php.ini.
Now search for “memory_limit”. Change the max amount of memory a script my consume and you should be good to go.
Addendum
In the comments below a user – Mike – suggested that the problem lies with the last line of code in the xmoov.php file.
print(fread($fh, filesize($file)));
change it to something like:
print(fread($fh, 8192));
That could help as well.
If something here has proved valuable to you then feel free to drop a couple of bucks in the tip-jar.






