PEAR installation on shared host Server

I have installed PEAR on my
localhost/apache server and
have no problem running pear
scripts such as HTLM Quickform
and validator. (php Anthology
Vol 1 & 2 by Harry Fuecks)
)

But I am having problems
getting Pear to install on
my Linux shared server.
GoDaddy say that Pear is loaded by
default with php4 and are not prepared
to assist in any further installations.

I know that a copy of the pear installation
can be uploaded to the folder where I host
my site. I ran the following script
and this shows that PEAR is enabled

<?php
include(“PEAR.php”);
$p = new PEAR();
print_r($p);
?>

:OutPut in browser:

PEAR Object
(
[_debug] =>
[_default_error_mode] =>
[_default_error_options] =>
[_default_error_handler] =>
[_error_class] => PEAR_Error
[_expected_errors] => Array
(
)
)
I have searched the forum but I am still
none the wiser. If there is anyone on the
forum who had been through the setup
procedure before I would welcome your help.
paradox1

You don’t need to install PEAR on your shared server. Just upload “your” PEAR packages to the server and add the location to the include_path.

Instead of uploading, do it the quick way…
Go to http://pear.php.net/index.php
Read the following sentence “to upgrade to the latest PEAR, you can either use go-pear (http://pear.php.net/go-pear)…”
Go to http://pear.php.net/go-pear
Download or copy it to a PHP file.
Run this live, on your web browser.
This should run the web based pear setup for you.
It should be very quick on a go-daddy shared server.
Note where the config page is (it will tell you at the end of the setup)
In the config pages, search for the packages you want and click the +
They should auto install for you.
Enjoy your pear.

Thank you for reply,
I created a folder of the root “/” where my website folder is
and I called it “pear”. this I understand is the include folder.
I uploaded by “ftp” PEAR:: validate.PHP from my local machine but I
didn’t upload HTML Quickform as yet.

For the setting include, I used the following script
<?php
ini_set(
“include_path”, (
“public_html/mydomainName.com/pear/PEAR-1.2.1/” .
PATH_SEPERATOR .
ini_get(“include_path”)
)
)
);
?>

and pasted this at the start of my php script file
but nothing was written to the browser after uploading
and running script. I need to check the file again, re: HTLM Quickform
was omitted initially. Am I on the right track with the include script
since I do not have access to the php.ini file on the host server.
the host server did provide me with a scaled down “php.ini” file
in my public folder, I was wondering can I use that and how.
paradox1

I use

ini_set('include_path', ini_get('include_path') . PATH_SEPERATOR .
  	      $_SERVER['DOCUMENT_ROOT'] . "/PEAR/");

require_once 'HTML/QuickForm/Renderer/Tableless.php';

But if you’re on a Windows server you need back slashes in the path instead of forward slashes.

Hi, thing2b:
I tried that:
http:// mydomain.com/go-pear.php in the address line
and I get output to the browser as follows,

&lt;?php //; echo; echo "YOU NEED TO RUN THIS SCRIPT WITH PHP!"; echo; echo "Point your webbrowser to it or run: php -q go-pear.php"; echo; exit # -*- PHP -*-
#
# The PEAR installation wizard, both webbased or command line.
#
# Webbased installation: etc etc..........

paradox1

If you are seeing the “<?php” start tag, then either the file doesn’t end with the “.php” extension, or you don’t have your server set up to parse PHP files.

Hi Mittineague & thing2b
got PEAR to install on server,

I deleted the old file (go-pear.php) from
the server and uploaded a new copy of the
file to the server. This time I saved the
go-pear script to notepad instead of using
(WeBuilder 2007)and saved as go-pear.php
(not forgetting to surround file name with
quotes otherwise you will still end
up with a text file) This worked and I was
presented with a Welcome to go-pear 1.1.1!
installation page.

I uploaded a php script to test out Html_Quickform
and I encluded the ini_set code at the top of the script.
and got the following error message

Fatal error: main(): Failed opening required ‘HTML/QuickForm/Renderer/Tableless.php’ (include_path=‘.:/usr/local/lib/phpPATH_SEPERATOR/home/content/p/a/r/paradox3/html/PEAR/’) in /home/content/p/a/r/paradox3/html/6.php on line 3
Has it something to do with .htacess file? I didn’t set this file
After installing PEAR, How do I access Pear from my homepage?
Paradox1

For some reason the PATH_SEPERATOR constant isn’t being replaced with a colon “:”.
If you try hard-coding it in like this

ini_set('include_path', ini_get('include_path') . ":" .
            $_SERVER['DOCUMENT_ROOT'] . "/PEAR/");

require_once 'HTML/QuickForm/Renderer/Tableless.php';

you should be all set.

EDIT: I just realized, PATH_SEPERATOR should be spelled PATH_SEPARATOR. (It’s one of the words I often spell wrong too, so I didn’t catch it right away)

I made the correction and ran the script again:

Parse error: parse error, unexpected ‘)’ in /home/content/p/a/r/paradox3/html/6.php on line.
Paradox1

<?php ini_get(‘include_path’) . PATH_SEPARATOR . $_SERVER[‘DOCUMENT_ROOT’] . “/PEAR/”); require_once ‘HTML/QuickForm/Renderer/Tableless.php’; ?>

Is the “)” at the -----> .“/PEAR/” ) :

The “extra” parentheses is meant to pair with the beginning one from the ini_set that the ini_get is nested inside of.

FINALLY… PEAR is now up and running;

To set include Path I used the following;
set_include_path(‘.:/home/myhost/public_html/pear/PEAR:/usr/lib/php:/usr/local/lib/php’ . PATH_SEPARATOR
. get_include_path());

I replaced .:/home/myhost/ etc etc with my own settings which is available via the configuration page
while pear is downloading to the server. SEE Webbased PEAR Package Manager, configuration page ::confused: PEAR Directory:
I found it usefull to print out the Config page since you will need to refer back to it later.

<?php set_include_path(‘.:/home/content/p/a/r/pxxxx3/html/PEAR:/usr/lib/php:/usr/local/lib/php’ . PATH_SEPARATOR
. get_include_path()); ?>