Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

pear errors from mail parser

Posted on 2013-01-15
11
Medium Priority
?
483 Views
Last Modified: 2013-02-04
this question is related to the code sample I received in
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_27993920.html

chdir(dirname(__FILE__));
require_once 'class.email.php';

// Parse incoming email from STDIN
$email = email::parseSTDIN();

//Who sent the message
$sender=($email->getSenderEmail() );
//TheMessage itself
$message = trim($email->getTextContent());
//Who the Message was sent to
$to =  ($email->getRecipientEmail());
//The Subject of the eMail
$subject = ($email->getSubject());

Open in new window



mail.zip


Warning: require_once(PEAR.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\mail\Mail\mimeDecode.php on line 65


require_once() [function.require]: Failed opening required 'PEAR.php' (include_path='.;C:\Program Files (x86)\NuSphere\PhpED\php5\..\include_lib') in C:\wamp\www\mail\Mail\mimeDecode.php on line 65
0
Comment
Question by:rgb192
  • 6
  • 4
11 Comments
 
LVL 6

Expert Comment

by:Kailash Aghera
ID: 38781355
You will have to put pear package file in your PHP "include_path" directory. You are receiving this error because PEAR.php is not available in your directory as well as in your PHP include path.
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 38781365
I think it must be path problem. You need to configure the right path there. check out, http://pear.php.net/manual/en/installation.getting.php
0
 

Author Comment

by:rgb192
ID: 38785432
do I change the location in one of the included files (see original question attachment)
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 6

Accepted Solution

by:
Kailash Aghera earned 2000 total points
ID: 38785794
Hi,

You will need to follow the below steps:

[1] Install pear package in your system if it is not installed
[2] Edit your php.ini file and add your pear package installation path in include_path like as follow:

include_path='.;C:\Program Files (x86)\NuSphere\PhpED\php5\..\include_lib;c:\pear'

Replace c:\pear with the location of your pear package.

[3] To find your php.ini upload phpinfo() page and check the location for "Loaded Configuration" file path. You will need to edit this php.ini.

[4] After making the changes, restart your web server.

Kailash
0
 

Author Comment

by:rgb192
ID: 38785819
do i have to change any of the attached mail files to include address of pear
0
 
LVL 6

Expert Comment

by:Kailash Aghera
ID: 38787615
Once you set pear package path in your php configuration, you do not need to modify any files or source. It should include pear module automatically when it is required..

Kailash
0
 

Author Comment

by:rgb192
ID: 38799854
I can not get pear to run on localhost wamp

but I uploaded file and folder to hostgator (which has pear)

 file ran with no errors and echo line number at the end (line 16)

<?php
chdir(dirname(__FILE__));
require_once 'class.email.php';

// Parse incoming email from STDIN
$email = email::parseSTDIN();

//Who sent the message
$sender=($email->getSenderEmail() );
//TheMessage itself
$message = trim($email->getTextContent());
//Who the Message was sent to
$to =  ($email->getRecipientEmail());
//The Subject of the eMail
$subject = ($email->getSubject());
echo __LINE__;

Open in new window


do I need to have this file be the pipe which is setup in cpannel.

if so, do I need a she bang at the top of script
0
 
LVL 6

Expert Comment

by:Kailash Aghera
ID: 38808523
do you want to execute this script via cron or do you want to use this script for other purpose?
0
 

Author Comment

by:rgb192
ID: 38813341
when email is received using email piping

or

reading input .eml file (easier for testing)
How should I change stdin to input .eml file
0
 

Author Comment

by:rgb192
ID: 38843326
could I replace line 5

// Parse incoming email from STDIN
$email = email::parseSTDIN();


with a copy paste email .eml file

$email='this is the eml file'
0
 

Author Closing Comment

by:rgb192
ID: 38852689
you told me to run on a server with pear which is a step in the correct direction

thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question