PEAR |
This is a discussion on PEAR within the PHP forums, part of the Development category; Hiya guys, I'm trying to install PEAR to use it's Mail feature (trying to move away from PHP 's mail() ... |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 |
| Member Join Date: Jan 2009 Location: Spain
Posts: 329
Thanks: 24
Thanked 26 Times in 25 Posts
![]() Expertise: PHP Experience: Professional |
Hiya guys, I'm trying to install PEAR to use it's Mail feature (trying to move away from PHP's mail() function). However, for some reason it doesn't seem to be recognising my include path to the pear directory. I've been following the instructions at: Manual :: Checking if PEAR works, and have got to the end, running the simple code: PHP Code: Code: [Tue Feb 16 14:59:52 2010] [error] [client xxx.xxx.xxx.xxx] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'System.php' (include_path='.:/usr/share/pear/') in test.php on line 2 Anyone have any ideas what might be going wrong here? Thanks! Stu |
| | |
| | #2 |
| Member Join Date: Jan 2009 Location: Spain
Posts: 329
Thanks: 24
Thanked 26 Times in 25 Posts
![]() Expertise: PHP Experience: Professional |
Hi All, This probably should have gone in server management, but never mind lol... On the upside I found a solution just in case anyone stumbles across this post in the future. Adding: Code: /usr/share/pear However, adding the following to the domains vhost.conf (located at: /var/www/vhosts/<my domain>/conf/vhost.conf) file did the trick: Code: <Directory /var/www/vhosts/<my domain>/httpdocs>
php_admin_value include_path "/var/www/vhosts/<my domain>/httpdocs/:/usr/share/pear/"
php_admin_value open_basedir "none"
</Directory>
Stu |
| | |
| | #3 |
| Member Join Date: Jan 2009 Location: Spain
Posts: 329
Thanks: 24
Thanked 26 Times in 25 Posts
![]() Expertise: PHP Experience: Professional |
Cancel that.. well edit it slightly! The code above: Code: <Directory /var/www/vhosts/<my domain>/httpdocs>
php_admin_value include_path "/var/www/vhosts/<my domain>/httpdocs/:/usr/share/pear/"
php_admin_value open_basedir "none"
</Directory>
For example, if you had a file in a directory named 'foobar': www.mydomain.com/foobar/foo.php, and this file had a line to call another file (in the same directory), e.g: PHP Code: So a little alteration to vhost.conf and all files in any directory work like clockwork: Code: <Directory /var/www/vhosts/<my domain>/httpdocs>
php_admin_value include_path ".:/usr/share/pear/"
php_admin_value open_basedir "none"
</Directory>
|
| | |
| | #4 |
![]() Join Date: Dec 2008
Posts: 1,844
Blog Entries: 3 Thanks: 13
Thanked 36 Times in 34 Posts
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Expertise: (X)HTML / CSS Experience: Professional |
Thanks for letting us know Stu.
__________________ WelshStew follow me on twitter here | WelshStew - Web Design & Web Development | Motorhome hire uk |
| | |
| | #5 |
| Member Join Date: Jan 2009 Location: Spain
Posts: 329
Thanks: 24
Thanked 26 Times in 25 Posts
![]() Expertise: PHP Experience: Professional |
Ok, me again lol Just come back to this to do it on a new server for a new client (I had obviously forgotten how to since I last did it!). And I should mention for anyone else that finds this (most likely me again in a years time! lol), that you will need to reconfigure the host to actually look for the new vhost.conf file if it wasn't there already. So once you have done all the above, run: Code: /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=<my domain> Simple! lol |
| | |
![]() |
| Tags |
| pear |
| Thread Tools | |
| Display Modes | |