PHP Error: Fatal error: Unable to read X bytes in Y.php on line 0
“Fatal error: Unable to read X bytes in Y.php on line 0″ is an error I got once after moving a site to another server. The file was encoded with Zend Optimizer so I could not check what is happening on line 0 that could make any problems.
How to get HTTP headers of any remote file?
Want to check Content-Type or Content-Length of a remote file without downloading whole file?
Then you should just request headers and not whole file from a remote server using HTTP protocol.
Here’s how to do this in PHP using fsockopen or cURL.
Open TGA with PHP: imagecreatefromtga
Need to read TGA files in PHP? Here’s an implementation of imagecreatefromtga, which reads 24 bit TGA images both RLE compressed and uncompressed. You can use it as any other imagecreatefrom* function.