Fatal error: Unable to read X bytes in /home/user/public_html/myfile.php on line Y

Problem:

I get this with some of my php files: Fatal error: Unable to read X bytes in /home/user/public_html/myfile.php on line Y

Solution:

This means that the file was uploaded as ASCII text (plain text) instead of as a binary file (1's and 0's). Some PHP codes require that it is transfered as a binary file and not as plain text. Setting your FTP client to force Binary mode, instead of allowing it to auto-detect the mode, will fix this problem 90% of the time.

Refer to the FTP client's website for specific instructions.

  • 38 Users Found This Useful
Was this answer helpful?

Related Articles

Configuring the PHP Environment With php.ini

Problem: How do I change the PHP environment for my site with php.ini? Solution:   To...

PHP with FastCGI

Problem: What is FastCGI for PHP? Solution: FastCGI for PHP makes all your PHP applications...

Upload_Max_Filesize

Problem: How do I change my upload_max_filesize? Solution: Summary Locate the php.ini...

Cron Jobs with PHP Files

How do I run a php file using Cron jobs?   From the cPanel, click the Cron Jobs icon and enter...

Basic Site Security Checklist

Remove malicious files and/or files you are not familiar with. While many PHP applications...