Re: Several questions

From: Date: Wed, 05 May 2004 13:14:09 +0000
Subject: Re: Several questions
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-12313@lists.php.net to get a copy of this message
Pete wrote:
Hi, I just installed PEAR for the first time and have several questions. Don't have too much experience so please forgive the very basic questions: 1) What ist the difference between the php.pear and the php.pear.general newsgroups/lists ?
     Just thought I ask so I don't make any people angry by asking in the
wrong place.
Read: http://pear.php.net/manual/en/support.php#support.lists for a description of what each list is for. As for php.pear - it is just a container for all the newsgroups/mailing lists. I.e. php.pear is not really a newsgroup for our purposes, but php.pear.general is, at least that is my understanding of the situation. I checked the php.pear newsgroup and found the following message:
    From:	Jim Winstead 	Date:	Thu Mar 15 18:13:18 2001
    Subject:	README: this list is now dead.
    Groups:	php.pear
the php-pear@lists.php.net mailing list is now retired. information on the new pear mailing lists can be found at http://www.php.net/support.php jim
2) How can I include a class that I need in a script ? I mean since they are under c:\php4\pear and my project folder is on e:\project\root .
You need to get your include_path setup so that 'c:\php4\pear' is in the include path. However, when you go to put these up on your webhost, you will have to setup include_path there to point to wherever you installed PEAR on your webhost. Since your webhost does not support pear, what you have to do is install pear into a subdirectory of your home directory somewhere. Is your host running some flavor of Unix, or Windows? Is PHP running as a CGI program, or as a server-module (e.g. the Apache module version of PHP is quite popular)? Depending on the answers to those questions, the exact method you use for setting up your include_path will be a little different. I suggest you read 'Chapter 4. Runtime Configuration' from the php manual, available at: http://www.php.net/manual/en/configuration.php My personal suggestion is that you create a global configuration file for your site, and then set auto_prepend_file to that file. auto_prepend_file is a configuration directive that causes PHP to automatically include() a file at the beginning of every script it runs. This makes it easy to then setup global variables (like, e.g. a DSN for connecting to mysql from your scripts), and you can put ini_set() lines in this global config file. For example, my webhost is running Apache on Linux, with PHP4 as an Apache Module. The Apache Module version of PHP allows you to specify configuration directives in a .htaccess file (a .htaccess file is a text file named .htaccess that you put in a directory that is part of your Apache document tree, and it contains information that apache reads to configure itself for your website). So, I put the following line in the .htaccess file at the top of my website's directory tree: php_value auto_prepend_file "/hsphere/local/home/welding/pcsi_global.php" (Well, my email client is wrapping it, but the above two lines would be one line in .htaccess.) Then, in pcsi_global.php, I have the following lines: <?php ini_set("include_path", ".:/path/to/my/home/pear/lib"); ?> Alternatively, you could just put in your .htaccess file something like: php_value include_path '.:/path/to/your/home_directory/pear'; There are other ways to specify configuration directives, in the case that your host isn't using the Apache module PHP engine. Read the manual entry I included a URL for above. Note that the include_path is a list of paths to search, separated by the ':' character. The '.' in the path above tells PHP to search the current directory (relative to the file that is include()ing another file). You probably want this. I would also suggest checking what the global include_path for your shared host is before setting up your own, because when you setup your own it 'hides' the global include_path. So, if you include any files provided by your webhost, you need to make sure the path for those files is in your include_path.
3) My webhost doesn't support PEAR but he told me that I could upload them mysql.How do I have to change around my project before I upload it from the test server to the production server ?
As I mentioned above, the key thing is to get the include_path right. Make sure you do *NOT* have an entry in your include_path that points to another version of PEAR (e.g. my webhost has an archaic version of PEAR installed globally - when I first installed PEAR I didn't realize that, and it caused me quite a few headaches because I was using calls to methods that weren't available in the older version, and couldn't figure out why it was telling me that the functions were undeclared).
4) Why are there some classes in the packet manager that give an error message when I try to download them?
    I am not talking about those that have dependencies .
Well, hard to say unless you tell us what error(s) you are getting. Jeff Schmidt

Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
« previous php.pear.general (#12313) next »