|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36255 fopen() does not work with batch files
Submitted: 2006-02-02 02:58 UTC Modified: 2006-02-10 01:00 UTC
Avg. Score:3.0 ± 2.0
Reproduced:1 of 2 (50.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: tecklord at argocom dot cv dot ua Assigned:
Status: No Feedback Package: URL related
PHP Version: 4.4.2 OS: Windows
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-02-02 02:58 UTC] tecklord at argocom dot cv dot ua
There is a problem in use of fopen() function in a batch file when requesting remote URI. It`s impossible to fetch any data via HTTP even if allow_url_fopen is set to On in php.ini. With local files fopen() seems to work correctly. Ex.
C:\PHP\php.exe -c "F:\php.ini" -f "F:\test.php"
C:\PHP>php.exe -v
PHP 4.4.2 (cgi-fcgi) (built: Jan 13 2006 13:53:43)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

the same code works correctly with 
F:\backup_php>php.exe -v
PHP 4.4.0 (cgi-fcgi) (built: Jul 11 2005 16:13:04)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

Reproduce code:
$url = "";
$fp = fopen($url, 'r');
if ($fp):
echo "yes";
echo "No";

Expected result:
"Yes" on the screen :)

Actual result:
There is no output at all, even with error_reporting = E_ALL in php.ini


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-02 11:58 UTC]
Add error_reporting(E_ALL) and ini_set("display_errors", 1); in the beginning of test.php.
 [2006-02-10 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Jul 28 11:01:24 2021 UTC