Re: 4.2.3, apache 2.0.40 file access problem
| From: | Bodo Scheumann | Date: | Tue, 10 Sep 2002 09:12:38 +0000 |
| Subject: | Re: 4.2.3, apache 2.0.40 file access problem | ||
| References: | 1 | Groups: | php.install |
| Request: | Send a blank email to php-install+get-8390@lists.php.net to get a copy of this message | ||
Vadim Akselrod wrote:
> I upgraded to 4.2.3, but am having file access problems.
>
> If I access a file by full path, it works fine.
> If I access a file in the local dir, it fails. Even though getcwd() is
> the same as the full path above.
>
> Any ideas? This is on redhat 7.2. Thanks!
>
> Cheers,
>
> -Vadim
>
> PS: Here's the code that fails:
>
> $file = "test";
> if(!is_writable(getcwd() . "/" . $file))... // works
> if(!is_writable($file))... // fails
Check out the access rights (in php.ini e.g.)
it is different to access a complete path and a relative path,
even if they point to the same file! (like for include())
you have to have a r/w access to '.' if to use the second version
(which may be dangerous!) so better to go through the hassle with the full
path!
regards
Bodo