LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-08-2011, 11:08 AM   #1
3rods
Member
 
Registered: Mar 2008
Posts: 70

Rep: Reputation: 16
Post How can I use PEAR from its shared directory in apache2?


I'm running the turnkey linux version of joomla and I need to use PHP's mail functionality to send a notification email from a page (separate from joomla content) . PHP's native stuff is rather plain and I find myself needing the functionality of PEAR. So I've installed PEAR via aptitude, but it has installed to /usr/share/php.

So, my question is, how do I include these files from php scripts? Firstly, the files are owned by root, the www-data user doesn't have access. It also appears that the permissions on the files may need to be modified. Some php files don't have the execute flag (shouldn't they)?

I recognize the point of having a centralized location for updates and sharing, so I don't want to just copy the files to my web directory (/var/www).

Symbolic link maybe?

Thanks!
 
Old 03-09-2011, 09:57 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,141

Rep: Reputation: 233Reputation: 233Reputation: 233
Hi

No, there is no need to symlink. Pear is a "packaging system" on it's own, so you need to "pear install" stuff after you have installed the pear package with aptitude.

Code:
sudo pear install mail
This downloads the mail stuff in /usr/share/php. And PHP has its own include_path which is similar to $PATH in the shell. It looks in many directories when you include/require files. By default, the include_path is ".:/usr/share/php:/usr/share/pear", so this should work:

PHP Code:
require "Mail.php"
 
1 members found this post helpful.
Old 03-10-2011, 10:52 PM   #3
3rods
Member
 
Registered: Mar 2008
Posts: 70

Original Poster
Rep: Reputation: 16
I was unaware of the path include directive in the php.ini file. That's what I was missing. Thanks.
 
  


Reply

Tags
apache2, pear, php


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing a local version of PEAR on a shared host Glowing Face Man Linux - Newbie 1 10-25-2009 05:00 PM
Apache2 - have to restart apache2 process every 10 mins to clear /tmp directory.... levi dehaan Linux - Software 8 09-01-2009 06:34 PM
install Pear Net/SMTP, Pear Log and Pear DB modules cccc Debian 0 02-26-2007 08:33 AM
shared pear folder ciscohead Linux - Software 0 07-25-2005 10:42 AM
Mandrake 10.1 Apache2 with PHp and pear problem Jediman Linux - Software 10 04-19-2005 03:35 PM


All times are GMT -5. The time now is 07:38 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration