skip to Main Content

I have got a website that was perfectly sending SMTP mail using the PEAR Mail package.

After I upgraded my domain to the PHP 8.1 version CGI, the function

$smtp->send($to, $headers, $email_body); stopped working!

Status code 500

the log file error is:
include_once(Net/SMTP.php): Failed to open stream: No such file or directory in /home/……./pear/share/pear/Mail/smtp.php

Therefore I tried to install it but the error this time was:

pear/Net_SMTP is already installed and is the same as the released version 1.10.0 install failed

and in the Chrome Developer Tools "network" response there is not a RESPONSE ! Empty!
Any idea?

2

Answers


  1. Chosen as BEST ANSWER

    SOLVED. Basically, after I upgraded my domain to the PHP 8.1 version, PEAR stopped working. The error I detected was:

    include_once(Net/SMTP.php): Failed to open stream: No such file or directory in /home/......./pear/share/pear/Mail/smtp.php

    Net_SMTP was installed but the server could not get the file BECAUSE OF PEAR CODE !!!!

    You have to change the path requests that are present in different files in PEAR:

     include_once __DIR__."/../Net/SMTP.php";//include_once 'Net/SMTP.php';
    
    require_once __DIR__."/../PEAR.php" //require_once 'PEAR.php';
    require_once __DIR__."/../PEAR.php"; //require_once 'PEAR.php';
    require_once __DIR__."/Socket.php";
    

  2. Your include path is not setup correctly.

    You need to have the pear base directory configured as part of the include_path in your php.ini.
    I guess that you got a new php.ini with php 8.1, which does not contain the modifications of the previous php version’s php.ini.

    The base directory is that directory in which the "Net" folder (that contains SMTP.php) resides in.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search