Re: mod_rewrite & open_basedir & pear
| From: | Stig S. Bakken | Date: | Tue, 28 May 2002 08:39:54 +0000 |
| Subject: | Re: mod_rewrite & open_basedir & pear | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-1470@lists.php.net to get a copy of this message | ||
On Tue, 2002-05-28 at 08:58, Alexei Tenitski wrote:
> Hi
>
> Can anyone please help me with a following problem.
>
> There's a script which uses PEAR library (namely, DB class)
>
> <?
> $dbhost=...
> $dblogin=...
> $dbpassword=...
> $dbname=...
>
> require_once("DB.php");
>
> $dsn = "mysql://$dblogin:$dbpassword@$dbhost/$dbname";
> $db = DB::connect($dsn, true);
> if (DB::isError($db)) die ("*** ".$db->getMessage());
>
> var_dump($db);
>
> ?>
>
>
> When i execute it everything is ok.
>
> BUT when i access this script via redirect by mod_rewrite
> it throws an error that open_basedir settings don't allow
> this require to be made
>
> .htaccess:
> RewriteEngine on
> RewriteRule test2.php /~xaxa/test/test3.php [L]
>
> test2.php,test3.php contain the code that i quoted above
>
> error:
>
> Warning: open_basedir restriction in effect. File is in wrong directory
> in /home/xaxa/public_html/test/test3.php on line 4
>
> Fatal error: Failed opening required 'DB.php'
> (include_path='.:/usr/local/lib/php') in
> /home/xaxa/public_html/test/test/test3.php on line 4
>
>
>
> Is there any way to overcome this problem?
>
> mod_rewrite is used to _hide_ urls from users and to _extend_ url with
> additional params.
Is there anything stopping you from doing the mod_rewrite things in PHP
with a 404 error handler? :-)
- Stig