 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
fredriley
Joined: 30 May 2008 Posts: 2
|
Posted: Fri May 30, 2008 9:57 pm Post subject: Using PHP to get PEAR info |
|
|
Hi
A maiden post, so please be gentle with me ). I have looked at the FAQs and searched the fora, but can't find the answer to the following:
How can I use PHP to get information about the PEAR installation on a server?
I want to try out PEAR in my PHP scripts on our university Unix system, on which I'm an ordinary user. I know that the system runs PHP 4.3.8 (yeah, I know, and I've nagged 'em about it), and I've tried from the command line to get pear info, but don't have the rights. If I try pear in /usr/local/bin/php I get:
| Quote: | ld.so.1: /usr/local/bin/php: fatal: libnss3.so: open failed: No such file or directory
Killed |
There is a usr/local/bin/pear script so the library must be installed somewhere, but I can't find out what version, what's its path, and what packages there are. I have tried including packages in a test script, eg with:
require_once "HTML/QuickForm.php";
but just get a 'no such file' error when I run it. There's no PEAR info in phpinfo() that I can find. Is there any way of using a PHP script to get PEAR info?
I know that I can install PEAR in my account but I'm very reluctant to do this as, if the test works out ok, I plan to deploy the application on a departmental account. Any tips/suggestions?
Cheers
Fred
PS: As an aside, I've had the devil of a time with PEAR on my Mac running OS/X 10.4.x, getting the dreaded package.xml version error, then getting 410 Gone errors (as reported at http://www.pear-forum.org/topic1892.html) when trying to upgrade/install packages, such that I've had to give it up as a bad job. My intention was to use the Mac as the test server (I'm running MAMP) and only when that failed did I try to use my Unix account on our main system. _________________ Learning Technologist
School of Nursing
University of Nottingham, UK |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1011
|
Posted: Sat May 31, 2008 7:45 pm Post subject: |
|
|
Which rights do you have on that server? Are you able to search for a file named 'PEAR.php'? If yes, you'll know the path that needs to be added to the include_path. If HTML_QuickForm is installed, your require_once call should work then. If PEAR_Info is installed, this package can give you some more information about the PEAR installation.
Why don't you want to install PEAR yourself? This would give you full "freedom", and this should also be possible on various other servers. |
|
| Back to top |
|
 |
fredriley
Joined: 30 May 2008 Posts: 2
|
Posted: Mon Jun 02, 2008 6:32 pm Post subject: |
|
|
| mark wrote: | | Which rights do you have on that server? Are you able to search for a file named 'PEAR.php'? If yes, you'll know the path that needs to be added to the include_path. |
Almost zero rights, but I could find that file under /usr/local/bin/php so I'll follow your suggestion of adding it to include_path.
| Quote: | | If HTML_QuickForm is installed, your require_once call should work then. If PEAR_Info is installed, this package can give you some more information about the PEAR installation. |
Thanks, that's a useful tip.
| Quote: | | Why don't you want to install PEAR yourself? This would give you full "freedom", and this should also be possible on various other servers. |
Because I want to write and test my application on my own account, then if/when it's working I'd want to put it on a departmental account. I don't want to tell the account admin that she needs to install PEAR as well as my scripts. Of course I could include the full path to PEAR on my account in the application scripts, but then if I get run over by a bus or find a horse's head in my bed, my account will be discontinued and the application will break.
There are political reasons as well, which is that web developers in our dept are hassling our uni sysadmins to upgrade to PHP 5, for all sorts of reasons, not least that 4.x is deprecated and will be increasingly insecure. I want to use PEAR as another stick to beat them around the head with
Thanks for the reply - very helpful.
Cheers
Fred _________________ Learning Technologist
School of Nursing
University of Nottingham, UK |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|