Jump to content

Pear Setup


sooty2006
 Share

Recommended Posts

just a quick question probably simple but i carnt get it to go back.im trying to use PEAR but its installed in this directory on my server!:/usr/share/psa-horde/pear/Mailbut my top page is as follows:/var/www/vhosts/my-site.co.uk/httpdocs/admin/act/sendmail.php if i was to use the require_once function it would only take me to httpdocs right?im not to sure is there anyone who can get me to use the php file in the pear/mail package?thanks.

Link to comment
Share on other sites

When Pear is installed the PHP include path should be updated to include the path to Pear. That means that if you do something like this:include 'Mail.php';first it will look in the current directory for a file with that name. If it can't find one, then it will go through the various include paths and check in each path for that file. You can use this to check the current include paths:http://www.php.net/manual/en/function.get-include-path.phpYou can also set the include path to add the path to Pear if it's not already set, before including the files. Pear itself uses relative includes for all of its files, so the include path needs to have the path to the base Pear folder.

Link to comment
Share on other sites

well i have already taken alook at my phpinfo function and it shows the following:include_path.:/usr/share/php5:/usr/share/psa-horde/pear/Mailin local and master so as far as iam concerned its there but its just not working!anymore ideas mate?thanks.

Link to comment
Share on other sites

That will work if you're just trying to include "Mail.php", but if that file relies on other include files then those include statements aren't going to work, because the path is set to Pear's mail folder instead of the base folder. Try adding /usr/share/psa-horde/pear to the include path, and then include "Mail/Mail.php".

Link to comment
Share on other sites

  • 2 weeks later...
Thanks justsomeguy,This seems to work but some are still bouncing ill keep you informed!
i was wrong, :) i now get this error constantly!Warning: require_once() [function.require-once]: open_basedir restriction in effect. File(/Mail/Mail.php) is not within the allowed path(s): (/var/www/vhosts/example.co.uk/httpdocs:/tmp) in /var/www/vhosts/example.co.uk/httpdocs/mail.php on line 7Warning: require_once(/Mail/Mail.php) [function.require-once]: failed to open stream: Operation not permitted in /var/www/vhosts/example.co.uk/httpdocs/mail.php on line 7Fatal error: require_once() [function.require]: Failed opening required '/Mail/Mail.php' (include_path='.:/usr/share/php5:/usr/share/psa-horde/pear') in /var/www/vhosts/example.co.uk/httpdocs/mail.php on line 7CURRENTLY = open_basedir = /var/www/vhosts/example.co.uk/httpdocs:/tmpwhat do i need to do to get it to work if i was to change this would there be any security issues?im not very familiar with php.ini i very nearly use it or mess with it?could you help me please?thanks. Edited by Scott Milner
Link to comment
Share on other sites

It shouldn't be a problem to add the pear directories to the basedir path.
i wouldnt know mate! im just strugling i think i have tried everything i just dont want to weaken my security if i dont know what im doing properly with the config file!
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...