[Mailman-Users] can't call command line functions from php

Anne Ramey anne.ramey at ncmail.net
Mon Sep 18 22:06:37 CEST 2006

Dragon wrote:
> Anne Ramey wrote:
>> I have my php script running as a user in the mailman group, but when I
>> try to do:
>>    //add user to Admin email list
>>    $command = "/usr/local/mailman/bin/add_members -r ".$Filename." 
>> admins";
>>    system($command, $status);
>> I get a status of 1 returned to me and it doesn't add the users.  I've
>> tried:
>>    shell_exec($command);
>> as well but it didn't work either.  I can successfully call these
>> functions from my old perl scripts, so I don't think it's a permissions
>> issue.  I think I must be missing something in the php.  This may be a
>> little out of the scope of this list, but any help would be appreciated.
> ---------------- End original message. ---------------------
> This is slightly off-topic but I am sure there are other users out 
> there who also use PHP for web scripting to interface to mailman (I do 
> on my system, I am far more comfortable with it than Python).
> This sounds like PHP is being run in safe mode and the scripts you are 
> trying to run are not allowed under the permitted safe-mode commands. 
> Safe mode is often enabled by ISPs running servers that host virtual 
> domains to prevent users from doing malicious and/or negligent things 
> that can damage the file hierarchy or compromise sensitive system 
> information. Chapter 9 of the PHP manual describes safe mode and how 
> it works.
> If you have error reporting to the browser turned off, you will need 
> to look in the HTTP server error log to see if PHP is complaining 
> about something. You might have to boost the error-reporting level in 
> your PHP script using the error_reporting function in your script to 
> get the level of detail you need.
> Dragon
My safe_mode is Off.  There are no errors in my http log and none output 
to the screen.  I can run other commands with system and 
shell_exec...just not any mailman commands.


More information about the Mailman-Users mailing list