Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
|
okay, so first, add this to the beginning of the php script:
PHP Code:
error_level(E_ALL); ini_set('display_errors', 1);
Re try your script, and tell us what exactly is the fopen() error, not the message you determined with an "or die()" condition.
Fopen() does not parse the file, it only gives back a pointer to iterate through the file. So it cannot be the size that causes the problem.
I'd rather think that the file was uploaded via ftp or via the network, and it's permissions are not low enough to allow the user that run the web server(usually nobody, or apache) to read the file.
Please ensure that your file is readable by everyone ("chmod 555 yourfile.txt" from a shell in the same directory as your file), it may be your problem.
For example, if a file is not found, fopen() should yield, given the following code:
PHP Code:
error_reporting(E_ALL); $h=fopen('lalal','r');
Quote:
|
Warning: fopen(lalal): failed to open stream: No such file or directory in /home/tmo/2.php
|
If the file is not readable:
Quote:
|
Warning: fopen(lalal): failed to open stream: Permission denied in /home/tmo/2.php on line 3
|
__________________
Only a biker knows why a dog sticks his head out the window.
|