View Single Post
Old 09-22-2014, 10:44 PM  
codingwelt
AdultCoding.com PHP Freak
 
Industry Role:
Join Date: Sep 2014
Location: Austria (Europe)
Posts: 58
It's possible, yes. But you shouldn't let a script log in as root user. You could allow a non-/less-privileged user to execute the command using php, so there wouldn't be that much impact if someone got access to the login details stored in the php file.
(see PHP commands like "exec", "system", "passthru", ... for executing system commands.)

But, why aren't you creating a cronjob for root user that executes sendmail -q for you? There's no need to do this in PHP if not absolutely necessary.
__________________
AdultCoding.com Webdevelopment - info [smth] adultcoding [smthelse] com - Skype: AdultCoding
Individual PHP development following the latest standards in the web industry.
Get in touch for a custom offer, now!
codingwelt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote