exec(), passthru(), system() and shell_exec() hang.

From: Date: Tue, 01 Apr 2003 11:35:27 +0000
Subject: exec(), passthru(), system() and shell_exec() hang.
Groups: php.general 
Request: Send a blank email to php-general+get-141806@lists.php.net to get a copy of this message
Hi everyone. I'm running a RedHat Linux 8.0 server with php 4.2.2 on apache. I'm having trouble using the system execution commands. If any of these commands are included in my script it hangs, I don't even get output that is flushed before the command: echo 'Text to be flushed'; flush(); $ud = passthru('command parameters'); What's wrong? The command executed is "sudo service dansguardian restart". I'm making a web interface for updating a config file for the service dansguardian. But the changes won't be used before the service has been restarted. On my old setup (RH 7.3) i could at least get the output with system() or passthru(), but the script would still hang. Now I get nothing. Well except if I comment out the system command, then everything works fine (no infinite loops that could cause the hang), but that doesn't get my service restarted.... I have edited my /etc/sudoers file so that the apache user can execute /sbin/service. It works fine in console (with another username (can't really su to apache)) Help me Lasse Riis

« previous php.general (#141806) next »