Portal Home > Knowledgebase > Articles Database > Safe Mode on - Cannot use PHP Mail Function..


Safe Mode on - Cannot use PHP Mail Function..




Posted by davida50000, 05-11-2010, 12:56 PM
We are on the same Server as the customer and we use LiveZilla and WHMCS that uses the PHP Mail Functions. However we have a customer that is trying to use his own PHP Mail Function and he is getting the following error: We do not want to disable Safe Mode in PHP as we believe it is a big security issue however is it possible for us to allow the use of these PHP Mail Functions? Thanks in advance! Dave.

Posted by Senator B, 05-11-2010, 06:32 PM
The "fifth parameter" is a catchall for any miscellaneous flags or options that your script might try to pass when invoking the mailer program. You have two options that I can think of: A) rewrite the script so it doesn't attempt to pass any parameters other than recipient/subject/message/additional headers. B) Turn off safe mode. My suggestion is "B", for a couple of reasons. First, safe mode is worse than useless - it really doesn't do much for system security, but it leads to a false sense of security, in the sense that you think you're protected when you're not. Second, as you can see, it blocks otherwise useful functions. Third, it's deprecated from 5.3 onward anyway, meaning that eventually it's likely to become extinct whether you like it or not. You're far better off ditching it and looking into something like suPHP, IMO.

Posted by davida50000, 05-11-2010, 07:19 PM
Thanks for the advice! Much appreciated! Dave.

Posted by Mark Muyskens, 05-11-2010, 07:24 PM
Second this. PHP 6 will not include Safe Mode.

Posted by davida50000, 05-12-2010, 12:47 PM
Safe Mode is actually doing quite a lot for us. For example with Safe mode enabled we have tested a shell.php script and all the functions that could cause damage to the server do not work. However, with Safe Mode disabled these functions that could cause damage are all available to anybody who decides to install a shell. Is there any alternative to use instead of the safe mode? Thanks.

Posted by davida50000, 05-14-2010, 06:27 PM
So can anybody please give us an alternative from Safe Mode to stop the things listed above Thanks. Dave.!

Posted by Senator B, 05-14-2010, 07:33 PM
Suhosin + suPHP is a good start.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
how to mod_rewrite (Views: 735)
Cisco routing question (Views: 692)
CHMOD 755 or 777 (Views: 659)