How to disable PHP mail function on one apache virtualhost?

5,406

I added this to my virtual host:

<Directory /dir/to/your/web/root>
...
        php_admin_value sendmail_path "tee mail.out > /dev/null"
...
    </Directory>

It worked!

Share:
5,406

Related videos on Youtube

darkw1nd
Author by

darkw1nd

Updated on September 18, 2022

Comments

  • darkw1nd
    darkw1nd almost 2 years

    I want to disable PHP function mail via Apache2 virtual host configuration file. I want to do it for one virtual host, not for all virtual hosts, and I don't want disable this function in php.ini

    How to do it correctly?

    Thanks in advance!

  • Brian Stinar
    Brian Stinar about 5 years
    Did this work for you? I'm getting a apachectl configtest ... /main.conf error: Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration