php and pear

selcane

New Member
Messages
17
Reaction score
0
Points
0
i've tried to just include a pear library and it's not working:

<?php
require_once '/x10hosting/php2/pear/PEAR/Validate.php';
echo "help";

?>

I dont see anything in the cpanel allowing me to install any pear packages. Is it allowed with a free account? maybe i need to upgrade php? how do i do that?

the reason i need the pear packages is for a secure contact us form.
i wrote a contact us php script which uses pears mail package to prevent mail injection and the validate package to prevent spam.
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
try the following code
PHP:
<?php
require_once 'Validate.php';
echo "help";
?>

However, I've also created my own personal installation using the go-pear script, through the browser.
 
Last edited:

selcane

New Member
Messages
17
Reaction score
0
Points
0
Hi, thanks for the response, i tried what u said, but still didnt work. i'm gonna try the go-pear thing, thanks for telling me about it!
Edit:
Hi, thanks for the response,
i also tried the go-pear thing, thanks for telling me about it,
but now i dont know what to do. i dont see the mail and validate classes there.
i dont know how to install the validate and mail packages, plus they each have dependencies on other packages. there should really be a link from the cpanel to allow pear package instalations. can you tell me how to install the validate and mail packages? thanks
 
Last edited:

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
To check if it works, use the code below
PHP:
<?php
require_once 'System.php';
var_dump(class_exists('System'));
?>
Should output "bool(true)". If it doesn't, add your local copy of pear to the include path (add this to the top of the script
PHP:
set_include_path('where/your/local/copy/is' . PATH_SEPARATOR . get_include_path());
=> see http://pear.php.net/manual/en/installation.checking.php


I don't have it configured on my server right now, but if I remember well, to install new packages you need to go to the web based package manager that was added in one of the web access folders you specified.
 
Top