1. I take php.ini :

     sudo vim /etc/php/7.0/cli/php.ini 
  2. Change ;sendmail = to sendmail = <my/path> .

  3. Save changes.

  4. Rebooting server:

     sudo service apache2 restart 
  5. Moving to my phpinfo() :

     http://test/php/info.php 
  6. The sendmail_path value has not changed:

     /usr/sbin/sendmail 

What could be the reason?

    1 answer 1

    The reason is that you are changing the configuration for the PHP client, not the Apache module. You need to change the corresponding value in the following file:

     sudo vim /etc/php/7.0/apache2/php.ini