note 31865 added to function.fopen
| From: | angelo at ispl dot ca | Date: | Wed, 07 May 2003 08:41:54 +0000 |
| Subject: | note 31865 added to function.fopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-47616@lists.php.net to get a copy of this message | ||
If you get weird errors that don't make sense, try replacing the PHP.INI file.
I was having trouble with fopen, receiving an error message saying "failed to open stream:
Invalid argument in...". I could read a file, but not create one with "a" or
"w". If I manually created a file, I could then change the contents, but PHP would not
create a new file. I was baffled; went over my code a hundred times, updated (downloaded and
compiled) new snapshots of PHP several times, and searched google without success.
I tried moving my code to another server running apache+php. It worked without the error. I
wondered if my PHP.INI file might be somehow corrupt, and I thought, hey, maybe there's been a
content change between 4.3.1 and 4.3.2RC2. I over-wrote my old php.ini with a new copy of the
distributed php.ini-recommended file, and it worked.
Might be nice if there was some mechanism, such as an embedded version number in the PHP.INI file
that was checked by the PHP engine, so one could be warned when the format or content of the file
changes.
--
http://www.php.net/manual/en/function.fopen.php
http://master.php.net/manage/user-notes.php?action=edit+31865
http://master.php.net/manage/user-notes.php?action=delete+31865
http://master.php.net/manage/user-notes.php?action=reject+31865