someguy321 Posted November 12, 2010 Share Posted November 12, 2010 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: include_once "Mail.php"; This will ALWAYS be false: 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. Quote Link to comment https://forums.phpfreaks.com/topic/218525-how-either-check-pear-installed-or-catch-include_once-statement/ Share on other sites More sharing options...
trq Posted November 12, 2010 Share Posted November 12, 2010 If I just include the file, it throws a warning error that I can't seem to catch in a try..catch. include* does not generate any error if it didn't work. Post your code. Quote Link to comment https://forums.phpfreaks.com/topic/218525-how-either-check-pear-installed-or-catch-include_once-statement/#findComment-1133666 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.