I am using version 1.9.16-201810301750
Apache server, php 7
Trying to read jpgs in a folder and for every single jpg in the folder I get "Could not open "myfile.jpg" (!is_readable; !is_file; !file_exists)".
I have tried on my local development server and on the production server, same results. Interestingly enough, on my local server it was able to read the .DS_STORE file.
I have checked all the folders and the files for permissions. The folders are all 755 and the files are all 644. The server is able to serve the images.
I will provide any other information you need.
Thank you.
"Could Not Open" errors
-
- User
- Posts:4
- Joined:Fri Nov 02, 2018 11:57 am
- Are you a spambot?:no
-
- getID3() v1 developer
- Posts:1477
- Joined:Fri May 04, 2001 4:00 pm
- Are you a spambot?:no
- Location:Northern Ontario, Canada
- Contact:
Re: "Could Not Open" errors
This is a PHP / OS / permissions issue, nothing specific to getID3.
Check OS user/file permissions
Check PHP/Apache restrictive settings such as safe_mode, open_basedir, etc
Check OS user/file permissions
Check PHP/Apache restrictive settings such as safe_mode, open_basedir, etc
-
- User
- Posts:4
- Joined:Fri Nov 02, 2018 11:57 am
- Are you a spambot?:no
Re: "Could Not Open" errors
So it's a PHP/OS/permissions issue that literally affects nothing BUT getID3. I gave you the permissions. The files are 644 and folders 755, so how should that prevent getID3 from opening the files? I'm passing complete paths. Apache is not in safe mode, and from my reading of open_basedir, it should not apply when a full path is given. And, as I said, the script is able to open the .DS_STORE file, which has the same owner/permissions as all the jpgs in the folder.
So, if my other PHP scripts are able to serve those files, and getID3 is able to open the .DS_STORE file in the same folder with the same owner/permissions, any more specific idea than "check OS user/file permissions" and "restrictive settings" as to why that might be?
So, if my other PHP scripts are able to serve those files, and getID3 is able to open the .DS_STORE file in the same folder with the same owner/permissions, any more specific idea than "check OS user/file permissions" and "restrictive settings" as to why that might be?
-
- getID3() v1 developer
- Posts:1477
- Joined:Fri May 04, 2001 4:00 pm
- Are you a spambot?:no
- Location:Northern Ontario, Canada
- Contact:
Re: "Could Not Open" errors
open_basedir, if enabled, always applies: it's a security configuration to prevent unwanted access outside the listed directories.
You could try a quick little test like this to run through the directory in question and see what PHP (totally unrelated to getID3) says about those files:
Code: Select all
$dir = '/path/to/files';
if ($dh = opendir($dir)) {
while ($file = readdir($dh)) {
$filename = realpath($dir.'/'.$file);
echo '('.(is_file($filename) ? '' : 'NOT ').'file) ('.(is_readable($filename) ? '' : 'NOT ').'readable) ('.(file_exists($filename) ? '' : 'NOT ').'exists) = '.$filename'."\n";
}
}
-
- User
- Posts:4
- Joined:Fri Nov 02, 2018 11:57 am
- Are you a spambot?:no
Re: "Could Not Open" errors
Thank you, I will try that.
-
- User
- Posts:4
- Joined:Fri Nov 02, 2018 11:57 am
- Are you a spambot?:no
Re: "Could Not Open" errors
Thank you. The files passed that test but you led me in the right direction in troubleshooting, and I got it working.
-
- getID3() v1 developer
- Posts:1477
- Joined:Fri May 04, 2001 4:00 pm
- Are you a spambot?:no
- Location:Northern Ontario, Canada
- Contact:
Re: "Could Not Open" errors
Excellent. Out of curiosity (and in case someone else has a similar problem), would you mind describing the solution you found?