PHP - Moved: Is Pear Installed On Mamp?
This topic has been moved to PHP Installation & Configuration.
http://www.phpfreaks.com/forums/index.php?topic=346325.0 Similar Tutorialshi, I am trying to send an email with an attachment using PEAR, I have installed PEAR and in my email script I am including teh mail.php and mail_mime.php pages but now I get an error: Fatal error: Class 'Mail' not found in /home/fhlinux129/e/edisongray.com/user/htdocs/PEAR/Mail/mail.php on line 51 Line 51: Code: [Select] class Mail_mail extends Mail { I want to use PEAR if it's installed and the regular "mail()" function if not. But to check for PEAR being installed, I can't check for the class PEAR existing because I have to include "Mail.php" first. The problem is that even though this statement works perfectly: Code: [Select] include_once "Mail.php"; This will ALWAYS be false: Code: [Select] if ( file_exists( "Mail.php" ) ) ... So how do I check for PEAR? If I just include the file, it throws a warning error that I can't seem to catch in a try..catch. This topic has been moved to PHPFreaks.com Questions, Comments, & Suggestions. http://www.phpfreaks.com/forums/index.php?topic=359084.0 This topic has been moved to Other Web Server Software. http://www.phpfreaks.com/forums/index.php?topic=346533.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=349480.0 This topic has been moved to Application Frameworks. http://www.phpfreaks.com/forums/index.php?topic=320893.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=351896.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=322457.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=350982.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=307948.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=314260.0 In my code I call PEAR::isError to see if there was an error in the SQL Query so I can log it but its always returning this error. Does anyone know a fix? I have tried to search google it and found http://pear.php.net/bugs/bug.php?id=9950 but it does not say how to fix it. Does anyone have any ideas? Error Non-static method PEAR::isError() should not be called statically $query = "SELECT Column FROM TableName"; $res = $db['database']->query($query); if (PEAR::isError($res)) { $logger->err("Error pulling results from DB. Query:" . $query); } I am trying to set up a new PHP environment on my newer Macintosh, and cannot seem to get my webserver, MAMP, to work properly. When I run my PHP code, Firefox launches and the URL says:
http://www.local.acme/index.php
I am using NetBeans for my IDE, and in the IDE, I have the "Project URL" defined as:
http://local.acme/
I assume there is some problem with how MAMP is set up, but am unsure. And I tried to copy all of the settings from my old setup on my old Macintosh, but having been away from all of this for about 2 years, I really have no recollection of how I set all of this up. Am a dead duck until I can get my dev and run enorionments working again. ?
Hi all I'm using MAMP and trying to install ImageMagick. Is there a way to test if it is correctly installed when using MAMP? ttmt This topic has been moved to Other Web Server Software. http://www.phpfreaks.com/forums/index.php?topic=347009.0 I just installed XAMP on my windws pc. When I try to launch my index.html file, I only get this output: Hello World";?>
This is not correct...
<html>
What is wrong? Hello, I'm fairly new to PHP, and I'm trying to get the GD2 library working but I am having no luck. I have installed the library, and when I run phpinfo(); it shows that it is up and running, and all file types are supported. However, when I run the following code snippet nothing is displayed: <?php $im = @imagecreate (200, 100) or die ( "cannot create a new gd image."); $background_color = imagecolorallocate ($im, 240, 240, 240); $border_color = imagecolorallocate ($im, 50, 50, 50); $text_color = imagecolorallocate ($im, 233, 14, 91); imagerectangle($im,0,0,199,99,$border_color); imagestring ($im, 5, 10, 40, "a simple text string", $text_color ); header ("content-type: image/png"); imagepng ($im); ?> I have been struggling with this for a couple of weeks now with no luck. Any help would be greatly appreciated. When I put all my code in one file, everything runs smooth, as soon as I try to put a chunk of code in a separte PHP file and use an include or require_once I get the error Assigning the return value of new by reference is deprecated in...PEAR\config.php yadda yadda I've done some research and I understand that passing an object by reference (&obj) is no longer acceptable in PHP 5, that's fine, but no where in my code do I have an ampersand, and again, it all works fine if it's all in the same .php file. So i figure i might be doing something wrong with my includes or something. The errors that I am getting are Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config.php on line 80 Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config.php on line 166 Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config\Container.php on line 111 Code: [Select] include('config.php'); connect(); while ($row = mysql_fetch_assoc($ran_result)) { $ran_image = $row['image']; $category = $row['category']; $last = $row['l_name']; $first = $row['f_name']; $return = $row['item_return']; } echo "<div id='random'>\n"; echo "<h1>Random Signatures</h1>\n"; echo "<img src='../auto_images/$ran_image' /><br />\n"; echo "<p><a href='../auto_pages/signatures.php?c=$category&l=$last&f=$first'>$first $last</a></p>\n"; echo "<p>$return</p>\n"; echo "<br>"; echo "</div>"; ?> Am I doing something wrong with the include? Hi all, Will reading on php.net about the famous mail() function somewhere in the notes, the author mentions to use Pear:: for sending larger amounts of email. Since I have never done anything with pear, I was wondering if it weren't better to start out with Pear, since it's more a long term thinking solution or shoudl i first start with mail(). I have read the Pear pagess, and all I saw were delayed mail sending and sending in larger quantities. If someone could maybe advise me on would could be a best practise i would love to hear I am trying to send an email to my gmail account using Mail SMTP. With the following code: <?php include 'incl/php/Mail.php'; $recipients = 'xxxxxxxx@gmail.com'; $headers['From'] = 'no-reply@newzstand.us'; $headers['To'] = $recipients; $headers['Subject'] = 'Test message'; $headers['Date'] = date('r', time()); $headers['Message-Id'] = '<'. microtime(true).'@newzstand.us>'; $body = 'Test message'; $domain = preg_replace("/.*@([^@]*)/", '\1', $recipients); $mxrr = getmxrr($domain, $mxhosts); $params['host'] = $mxhosts[0]; $params['localhost'] = 'mail.newzstand.us'; $params['username'] = 'no-reply'; $params['password'] = 'xxxxxxx'; // Create the mail object using the Mail::factory method $mail_object =& Mail::factory('smtp', $params); $send = $mail_object->send($recipients, $headers, $body); if (PEAR::isError($send)){ echo $send->getMessage(); }else{ echo 'No error'; } ?> I get the following message: Failed to connect to alt2.gmail-smtp-in.l.google.com:25 [SMTP: Failed to connect socket: Connection refused (code: -1, response: )] Why is Gmail refusing me? |