Page 1 of 2

something is configured wrong (pear and mail classes)

Posted: Wed Aug 16, 2006 12:52 pm
by jmilane
This latest issue has come up because I am trying to send mail through a SMTP server but I cant figure out where to put the swiftmail folder (once it is extracted).

I dont know what is going on.

PHP tells me Fatal error: Class 'PEAR' not found in C:\apachefriends\xampp\php\pear\Net\Socket.php on line 35

And Fatal error: Class 'Mail' not found in C:\apachefriends\xampp\php\pear\Mail\smtp.php on line 26

Thing is... I have PEAR in my PHP folder and I have MAIL in my PEAR folder

Something is not configured correctly??

Posted: Wed Aug 16, 2006 1:36 pm
by feyd
Pear requires some installation before it can be used. The documentation can be a bit hard to find.

http://pear.php.net/manual/en/installation.getting.php is the starting point.

Alternatively, you could use a different emailing package such as Swift or phpMailer.

Posted: Wed Aug 16, 2006 1:52 pm
by jmilane
feyd wrote:Pear requires some installation before it can be used. The documentation can be a bit hard to find.

http://pear.php.net/manual/en/installation.getting.php is the starting point.

Alternatively, you could use a different emailing package such as Swift or phpMailer.
I tried swift.

Both the Mail class and Pear class cannot be found:

Fatal error: Class 'PEAR' not found in C:\apachefriends\xampp\php\pear\Net\Socket.php on line 35

Fatal error: Class 'Mail' not found in C:\apachefriends\xampp\php\pear\Mail\smtp.php on line 26

Posted: Wed Aug 16, 2006 1:56 pm
by feyd
jmilane wrote:I tried swift.
and?
jmilane wrote:Both the Mail class and Pear class cannot be found:

Fatal error: Class 'PEAR' not found in C:\apachefriends\xampp\php\pear\Net\Socket.php on line 35

Fatal error: Class 'Mail' not found in C:\apachefriends\xampp\php\pear\Mail\smtp.php on line 26
Thanks for repeating your original post. :roll:

Posted: Wed Aug 16, 2006 1:59 pm
by Chris Corbyn
~jmilane, is there anything you need help with in swift? Or anything you find unclear in the documentation. I do like feedback... even bad feedback ;)

Posted: Wed Aug 16, 2006 1:59 pm
by jmilane
feyd wrote:
jmilane wrote:I tried swift.
and?
jmilane wrote:Both the Mail class and Pear class cannot be found:

Fatal error: Class 'PEAR' not found in C:\apachefriends\xampp\php\pear\Net\Socket.php on line 35

Fatal error: Class 'Mail' not found in C:\apachefriends\xampp\php\pear\Mail\smtp.php on line 26
Thanks for repeating your original post. :roll:
Dude, my original post actually says that I cannot figure out where to put the extracted swiftmail folder. I am trying to use swiftmail, and the errors I posted are what results.
8O

Posted: Wed Aug 16, 2006 2:00 pm
by jmilane
d11wtq wrote:~jmilane, is there anything you need help with in swift? Or anything you find unclear in the documentation. I do like feedback... even bad feedback ;)
Hey... yeah... I just dont know what to do with the folder once it is downloaded... I am kind of stupid I guess.

Posted: Wed Aug 16, 2006 2:06 pm
by Chris Corbyn
jmilane wrote:
d11wtq wrote:~jmilane, is there anything you need help with in swift? Or anything you find unclear in the documentation. I do like feedback... even bad feedback ;)
Hey... yeah... I just dont know what to do with the folder once it is downloaded... I am kind of stupid I guess.
Just rename the entire folder from say "Swift-2.1.10" to "swift". Then upload that entire folder to your website somewhere where PHP can access it. You don't need to move any of the files out of the folder or anything, it will works as is.

Make sure you download the PHP4 version if you are using PHP4 or the other versions will give parse errors.

The errors you got did not come from the swift mailer library... those errors relate to PEAR and Swift Mailer has no class called. Mail.

http://www.swiftmailer.org/docs/ ;)

Posted: Wed Aug 16, 2006 2:07 pm
by jmilane
d11wtq wrote:
jmilane wrote:
d11wtq wrote:~jmilane, is there anything you need help with in swift? Or anything you find unclear in the documentation. I do like feedback... even bad feedback ;)
Hey... yeah... I just dont know what to do with the folder once it is downloaded... I am kind of stupid I guess.
Just rename the entire folder from say "Swift-2.1.10" to "swift". Then upload that entire folder to your website somewhere where PHP can access it. You don't need to move any of the files out of the folder or anything, it will works as is.

Make sure you download the PHP4 version if you are using PHP4 or the other versions will give parse errors.

The errors you got did not come from the swift mailer library... those errors relate to PEAR and Swift Mailer has no class called. Mail.

http://www.swiftmailer.org/docs/ ;)
Okay. You rock.

I will stick the swift folder right in the PHP folder.

I think that will work.

Thanks!

Posted: Wed Aug 16, 2006 2:21 pm
by jmilane
Warning: require(../../Swift.php) [function.require]: failed to open stream: No such file or directory in C:\apachefriends\xampp\htdocs\testswift.php on line 3

I know I am doing something really dumb. I dont know where to set this path. I have 2 php.ini files... one for php4 and one for php5. I am using php5. Nowhere in there do I see an include path.

I always hated having this problem with my eye but now I am really upset about it. There is so much to read.

Posted: Wed Aug 16, 2006 3:00 pm
by Chris Corbyn
jmilane wrote:Warning: require(../../Swift.php) [function.require]: failed to open stream: No such file or directory in C:\apachefriends\xampp\htdocs\testswift.php on line 3

I know I am doing something really dumb. I dont know where to set this path. I have 2 php.ini files... one for php4 and one for php5. I am using php5. Nowhere in there do I see an include path.

I always hated having this problem with my eye but now I am really upset about it. There is so much to read.
Look at the path. Change the path in require() to match.

Code: Select all

require('swift/Swift.php');
require('swift/Swift/Connection/SMTP.php');

Posted: Wed Aug 16, 2006 3:06 pm
by jmilane
d11wtq wrote:
jmilane wrote:Warning: require(../../Swift.php) [function.require]: failed to open stream: No such file or directory in C:\apachefriends\xampp\htdocs\testswift.php on line 3

I know I am doing something really dumb. I dont know where to set this path. I have 2 php.ini files... one for php4 and one for php5. I am using php5. Nowhere in there do I see an include path.

I always hated having this problem with my eye but now I am really upset about it. There is so much to read.
Look at the path. Change the path in require() to match.

Code: Select all

require('swift/Swift.php');
require('swift/Swift/Connection/SMTP.php');
I just dont get it.

Doesnt work.

Posted: Wed Aug 16, 2006 3:13 pm
by feyd
What's the full path to Swift.php?

Posted: Wed Aug 16, 2006 3:14 pm
by jmilane
feyd wrote:What's the full path to Swift.php?
C:\apachefriends\xampp\php\Swift

And this file that I am running is at

http://127.0.0.1/testswift.php

C:\apachefriends\xampp\htdocs is my root directory

so why isnt ../php/Swift/swift.php working?

Posted: Wed Aug 16, 2006 3:17 pm
by feyd

Code: Select all

require('/apachefriends/xampp/php/Swift/Swift.php');
require('/apachefriends/xampp/php/Swift/Swift/Connection/SMTP.php');
would likely work then.