Insert PHP
[resolved] require issue (3 posts)

  1. Rovaron
    Posted 2 years ago #

    i'm trying to require an class(phpMailer) but for some magic reason i can't.

    this is the error:
    Fatal error: require() [function.require]: Failed opening required 'http://www.toplifefiltros.com.br/distribuidor-oficial/wp-content/themes/toplife/class.phpmailer.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/toplifef/public_html/distribuidor-oficial/wp-content/plugins/insert-php/insert_php.php(48) : eval()'d code on line 2

    sorry for the bad english and for the newbie question too.


  2. WillBontrager
    Plugin Author

    Posted 2 years ago #

    Rovaron, when the error message contains ": eval()'d code on line...", then the issue is almost certainly with the PHP code being processed instead of with the plugin itself.

    Put your code in a stand-alone PHP script. Upload the PHP script to your server and type its URL into your browser. Probably, you'll get a similar error message minus the "eval()'d code" part.

    I don't know what the rest of your code looks like, so I'm guessing at a solution. My thought is your PHP installation does not allow http://... URLs in the require() statement. See

    Try this solution:

    require( $_SERVER["DOCUMENT_ROOT"] . "/distribuidor-oficial/wp-content/themes/toplife/class.phpmailer.php" );

    I hope it works for you.


  3. WillBontrager
    Plugin Author

    Posted 2 years ago #

    Gratuitous content so the system will accept the "resolved" checkbox.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Insert PHP
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic