Introduction
I'm creating an Android app for webpage that runs on Joomla 1.5. Yes I know that it's an old version etc. but it's not my site and I can't do anything about it. So basically I'm creating a PHP script that fetches data from database and returns it as JSON. Website uses gallery extension: http://www.joomlaworks.net/extensions/free/simple-image-gallery
So I have images directory for example: images/stories/news/today-news
and in this directory are photos that are displayed on website.
Now in my script I'm using PHP scandir()
function to list all the images from given directory.
Problem
For some directories scandir()
returns list of files but for other directories it returns null
.
Let's say we have two directories:
images/stories/news/today-news
- for this directory it's working correctly
images/stories/news/yesterday-news
- for this directory it returns null
When I open first (working) directory in webbrowser then I get 403 Forbidden
which I think is correct. But when I open second directory it returns 404 Not found
like there is no directory like this. But on Joomla website both directories seems to work. I can see galleries from both directories.
Both of them have chmod 755.
What can be wrong? What am I missing?
scandir()
is either anarray
orfalse
and notnull
. – Farahmand Oct 8 '14 at 9:47is_dir()
? Do you have an ftp account to check whether it's a directory or not? Did you check the.htaccess
file? – Farahmand Oct 8 '14 at 11:55