Re: [PHP] problems with permissions or getting access to a file

[email protected] (Richard Quadling)
Newsgroups php.general
Message-ID <[email protected]>
On 11 February 2010 09:31, Pat <[email protected]> wrote:
> Richard Quadling wrote:
>>
>> On 10 February 2010 16:31, Pat <[email protected]> wrote:
>>
>>>
>>> hi all
>>> having trouble here with a site that I am hosting on go-daddy
>>>
>>> I want to keep my php and my images apart
>>>
>>> so to do this I have the base directory which contains the php scripts.
>>> On
>>> the directory above that I have
>>> my photos stored in /photos
>>>
>>> when I run my scripts I get the following:
>>>
>>> time -4 hours1265815323 <
>>> *Warning*: filemtime() [function.filemtime
>>> <http://www.patrickrice.net/tomdcam/function.filemtime>]: stat failed for
>>> testPanasonicCamMotion20100201022429140.jpg in
>>> */home/content/j/a/c/jackcards/html/tomdcam/MotionCamLast1Hours.php* on
>>> line
>>> *16*
>>>
>>> 1265815323
>>>
>>> *Warning*: filemtime() [function.filemtime
>>> <http://www.patrickrice.net/tomdcam/function.filemtime>]: stat failed for
>>> testPanasonicCamMotion20100201022429140.jpg in
>>> */home/content/j/a/c/jackcards/html/tomdcam/MotionCamLast1Hours.php* on
>>> line
>>> *28*
>>> 0
>>> time -4 hours1265815323 <
>>> *Warning*: filemtime() [function.filemtime
>>> <http://www.patrickrice.net/tomdcam/function.filemtime>]: stat failed for
>>> testPanasonicCamMotion20100201022619570.jpg in
>>> */home/content/j/a/c/jackcards/html/tomdcam/MotionCamLast1Hours.php* on
>>> line
>>> *16
>>>
>>> *_The script is the following below _from running this script, I keep
>>> getting this error, now when I copy this script in to the directory photo
>>> where the photos are stored, the script displays the images with no
>>> problems
>>> leaving me think that the issue is with the permissions, I have modified
>>> the
>>> pre-emptions to give all access as a test and still problems. Anyone got
>>> any
>>> Ideas??
>>>
>>> Thanks in advance.
>>> Pat

>>
>> read() only returns the filename, not the full path.
>>
>> So, when the script is in the same directory, the current directory
>> contains the required file.
>>
>> Try using ...
>>
>> filemtime(realpath($f))
>>
>> instead.
>>
>>
>
> Thanks Richard, It was really wrecking my head.
> Pat
>

No problem.

-- 
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.