Re: DB_DataObject, to work what do I need
| From: | Pierre-Alain Joye | Date: | Sun, 08 Sep 2002 21:25:37 +0000 |
| Subject: | Re: DB_DataObject, to work what do I need | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-8953@lists.php.net to get a copy of this message | ||
On Sun, 8 Sep 2002 16:35:20 -0500
"Peter J. Schoenster" <peter@schoenster.com> wrote:
> No, those are shared by all users on the system. I cannot impose my preference on all.
You do not have to.
> > Ok so you have an ssh access. If you can use ini_set or the thingie i
> > explained above that should do it ;)
>
> I have ssh access to MY files on the system.
Good, but not needed.
> http://www.php.net/manual/en/function.ini-set.php
>
> As I understand ini_set, I put it in php files and it depends on settings in php.ini which I
> don't control. But I'm certainly not going to mess with ini_set for
> other people's files.
ini_set set preferences for the current session. Nothing after, nothing before. Putting it in an
htaccess just make your life easier as far you do not need to put this command in every scripts.
> Here is what I do on one of my servers to tell Perl where to find my local modules:
>
> setenv PERL5LIB /usr/home/rede1/usr/local/lib/site_perl
>
> so when I run Perl at the command line it finds my modules. Works like a charm. I put the above
> path in my httpd.conf on that server so Apache knows
> where they are. I have no problems.
>
> But I don't understand how to do this with Pear. I know I can use an include path for
> simiple php classes I created and put it in the document root in
> .htaccess as such:
>
> php_value include_path ".:/home/pschon/php_modules"
> php_flag safe_mode on
> php_flag register_globals off
Here is a sample usage (the one I use to develop pearweb), this comes from my httpd.conf
php_admin_value include_path ".:/data/host1/lib/php"
php_flag magic_quotes_gpc off
php_flag magic_quotes_runtime off
php_flag register_globals Off
php_flag allow_call_time_pass_reference Off
> And that works for Pear. But my system is using Pear from somewhere else, somewhere controlled
> by the ROOT server:
Your runtime settings (ini_set) overide the default one.
> > bash-2.05$ whereis pear
> > pear: /usr/bin/pear /usr/local/bin/pear
just run a go-pear with YOUR user, specify prefix in YOUR library folder. And run the pear command
from ~/pear/bin/pear.
> > bash-2.05$ ls -la /usr/local/lib/php/PEAR.php
> > -rw-r--r-- 1 root root 24378 Jul 22 11:55
> > /usr/local/lib/php/PEAR.php
>
> I cannot install a local version of Pear. What about determining the version of pear. I
> can't just do a pear v
> > bash-2.05$ /usr/bin/pear -v
> > <br />
> > <b>Fatal error</b>: Failed opening required 'PEAR.php'
> > (include_path='') in <b>/usr/bin/pear</b> on line
> > <b>27</b><br />
> > bash-2.05$
> I find it terribly odd that it outputs html to the command line.
RTFM, set output html error.
> How can I set that include_path ? I tried putting it in my .bash_profile but it did not help
Damned, please listen to us AND FORGET PERL :-). Your include path if it has to be different from
the one defined in php.ini must be set by the ini_set command in your script. Or, for a php running
under apache, it can be define as php_admin_value in your http.conf.
So in resume :
In console mode :
Setup a local installation of pear, run the pear command ONLY from this installation.
In Web environment:
Set the include_path to the correct folder, using ini_set in one of this way :
- within your script using ini_set('include_path','.:/path/to/your/pear/tree');
- in httpd.conf file, inside YOUR host section
- in an htaccess file in the document root folder of YOUR host.
Hope that will help, it seems you mixe all the runtime environment, this is quit different if php
runs under console oder as a module.
Come back if that does not work, try to test it in web using the infos I gave you here.
pa