Re: installing pear in windows environment

From: Date: Mon, 16 Jun 2003 15:33:28 +0000
Subject: Re: installing pear in windows environment
References: 1 2 3 4  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-6003@lists.php.net to get a copy of this message
Cher Pierre-Alain, Stan, Jeroen, Lukas, (et al) > > I'll be honest with you, I have never gotten PEAR to install properly > > on a windows machine. I always have some kind of a glitch, so I just > > do it the hardway and download everything as I need it and install it > > individually. > > I'll be honest as well, I would like to know which glitches, windows and > so on :) I'll be honest [only because of your good examples], I'm no PHP (or PEAR) expert. I have managed to get PEAR running under Windows though (so there is hope...) Observation nr 1: the guys who have been 'around' for a while, and most/all of the online articles I have read are either dismissive of PEAR under Windows or offer advice that 'should work' - in other words are obviously *NIX users and trying to be helpful but haven't actually tested their words under Windows. Caveat emptor! Observation nr 2: the PEAR world seems to be quite fast changing, especially in recent times, and in particular the Windows-PEAR subset. Which means [Obs 1] that existing advice/tutorials should be re-positioned in 'the round file'. Observation nr 3: the inline/in-system docs do not make it easy to work out what to do when, and bury pertinent information in the mass. Observation 4: Despite the fact that Windows has hitherto been impossible/neglected/difficult [cf *NIX], none of the published tutorials/articles discuss the (?new) browser interface - which being lowest common denominator is probably the best way to go [kudos to the hero who made it possible - see docs] I originally decided it was time (for me) to take a look at PEAR, courtesy of some inspiration in PHP Magazine (issue 2.03) [recommendation/no affiliation]. The coverage therein was *NIX, and trying the instructions at the Windows command line/DOS box just didn't work - commands were rejected/misunderstood/irrelevant (who knows???) and the attempt died in a blizzard of errmsgs. I finally got it going [thinks!]. However last weekend when I wanted to go back to review some of the packages' documentation/info [sparse - ironic if you are looking into PEAR because you've been told about PHPdocumentor!!!???], I couldn't get it to go (again!). So in the grand M$ tradition, I wiped it out and started over... Herewith, as best I can, the 'magic formula' for the PEAR installer under Windows: NB I run Apache/2.0.45 (Win32) PHP/4.3.2 under Win2000, and totally within the firewall for local dev only. I use a separate Apache VHost on 127.0.0.1 for each project, defined in httpd.conf, and with name resolution handled in the hosts file (so I can work stand-alone/away from any name server/here or at clients' premises). 1 I set up a new project directory under my WebWork folder called PEAR, copied its path into PHP.ini as an additional directory in the "include_path=" setting, set it up as a VHost under Apache, and a hostNm under Windows. [three-finger salute necessary] I tested this by copying in my favorite test.php source code = an echo of the vhost/dirNm and a call to phpinfo(). 2 I 'found' go-pear.php and the go-pear-bundle folder in my PHP directory tree [warning: I can't remember if this 'came' as part of the PHP distribution, or if I downloaded it from the PEAR site* per instructions previously appearing in this thread/the magazine article], and copied these into my new PEAR folder/web site. 3 in IE called for http://PEAR/go-pear.php and up she came. [I didn't get any of the graphics (but that was no big deal), so I guess I was doing it from the wrong place, but my PHP or PHP/cli folders are not VHosts so the instructions telling me to work from there were quite useless] 4 within the dialog I asked for the basic packages to be installed (small check box). 5 It asked me where I wanted the downloads/installation to go [it isn't clearly explained what these various sub-dirs are for, but eventually (after more than a couple of attempts) I have settled on a pattern that appears to work] bin_dir = "drv:\path\WebWork\PEAR" php_dir = "drv:\path\WebWork\PEAR" doc_dir = "drv:\path\WebWork\PEAR\docs" data_dir = "drv:\path\WebWork\PEAR\data" test_dir = "drv:\path\WebWork\PEAR\tests" cache_dir = "drv:\path\WebWork\PEAR\cache" NB remember the frequent objection to the M$ habit of including a space inside a parth/dirNm - and in this case it cannot be alleviated by using quotation marks, so ensure all dirNms are in 8.3 style, eg MyDocu~1 instead of "My Documents", if appropriate. NBB if the first two paths were not the same, I ended up with a path that looked like "drv:\path\WebWork\PEAR\PEAR" and the last four dirs/paths (which use the second as a prefix) all repeating the PEAR and/or ending up an unnecessary one [extra] layer down in the file system hierarchy. NBBB I can't figure out what the bin_dir* is used for, nor can I recall if I wasn't also asked for a path to the PHP CLI/sapi/something dir. 6 the five basic folders were created and files copied in, as appropriate. 7 various other packages were copied down, as requested, and installed in appropriately named sub-folders of drv:\path\WebWork\PEAR. 8 I am now able [at any later time] to return to PEAR's online repository of packages (and their 'documentation') by calling up IE and typing in http://PEAR/index.php. [wonderful!] et voila! * I'm sure that greater minds than mine can clarify these points and someone with a knowledge of what the PEAR installer is actually setting up might care to offer a critique/improvement to what I've [innocently/ignorantly] done - and improve things. Meantime, my motto is KISS=keep it simple, stupid [amongst other things], ie go for the lowest common denominator, because then I can carry things between Windows and *NIX - and v-v! If <=two other folk would like to collaborate, I will happily improve on the above and forward it to [?whoever] for consideration in the installation instructions/docs. The two other folk? 1 a PEAR specialist who knows the implications of each of the installation questions/can answer the queries above, and 2 an innocent Win user with a PEAR-free system to do user-testing... Regards, =dn

« previous php.pear.general (#6003) next »