php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13090 function is unable to find files via absolute path.
Submitted: 2001-09-01 11:05 UTC Modified: 2001-09-01 12:05 UTC
From: m dot kumar at gmx dot at Assigned:
Status: Not a bug Package: GetImageSize related
PHP Version: 4.0.6 OS: win2k
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: m dot kumar at gmx dot at
New email:
PHP Version: OS:

 

 [2001-09-01 11:05 UTC] m dot kumar at gmx dot at
config: php 4.0.6 win32 binary dist, apache 1.3.20.

while calling getimagesize on a file with relative path or via URL works, it fails to find a file specified via absolute path.
example:

verified path via browser is:
http:/127.0.0.1/pics/foo/blah.jpg

from a script in directory /pics called:
getimagesize("foo/blah.jpg") .. works
getimagesize("http:/127.0.0.1/pics/foo/blah.jpg") .. works
getimagesize("/pics/foo/blah.jpg") .. fails:
Unable to open '/pics/foo/blah.jpg' for reading.

mike.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-09-01 11:48 UTC] rasmus@php.net
Are you sure that is the right path and not relative to your document root?  It wants the real on-disk absolute path.
 [2001-09-01 12:04 UTC] sander@php.net
/pics/foo/blah.jpg
Means on Windows, in a php script:
[current drive, ie. C]:\pics\foo\blah.jpg
On all platforms, in a request to a webserver, it means:
[documentroot]/pics/foo/blah.jpg
Use "$DOCUMENT_ROOT/pics/foo/blah.jpg" in your PHP-script to emulate this behaviour.

 [2001-09-01 12:05 UTC] sander@php.net
Oops... not closed, it's a bogus...
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 11:01:25 2019 UTC