PROC_TERMINATE(3) 1 PROC_TERMINATE(3)proc_terminate - Kills a process opened by proc_openSYNOPSIS
bool proc_terminate (resource $process, [int $signal = 15])
DESCRIPTION
Signals a $process (created using proc_open(3)) that it should terminate. proc_terminate(3) returns immediately and does not wait for the
process to terminate.
proc_terminate(3) allows you terminate the process and continue with other tasks. You may poll the process (to see if it has stopped yet)
by using the proc_get_status(3) function.
PARAMETERS
o $process
- The proc_open(3) resource that will be closed.
o $signal
- This optional parameter is only useful on POSIX operating systems; you may specify a signal to send to the process using the
kill(2) system call. The default is SIGTERM.
RETURN VALUES
Returns the termination status of the process that was run.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.2.2 | |
| | |
| | Previous versions used to destroy the given |
| | process $resource. |
| | |
+--------+---------------------------------------------------+
SEE ALSO proc_open(3), proc_close(3), proc_get_status(3).
PHP Documentation Group PROC_TERMINATE(3)
Check Out this Related Man Page
POPEN(3) 1 POPEN(3)popen - Opens process file pointerSYNOPSIS
resource popen (string $command, string $mode)
DESCRIPTION
Opens a pipe to a process executed by forking the command given by $command.
PARAMETERS
o $command
- The command
o $mode
- The mode
RETURN VALUES
Returns a file pointer identical to that returned by fopen(3), except that it is unidirectional (may only be used for reading or writing)
and must be closed with pclose(3). This pointer may be used with fgets(3), fgetss(3), and fwrite(3). When the mode is 'r', the returned
file pointer equals to the STDOUT of the command, when the mode is 'w', the returned file pointer equals to the STDIN of the command.
If an error occurs, returns FALSE.
EXAMPLES
Example #1
popen(3) example
<?php
$handle = popen("/bin/ls", "r");
?>
If the command to be executed could not be found, a valid resource is returned. This may seem odd, but makes sense; it allows you to
access any error message returned by the shell:
Example #2
popen(3) example
<?php
error_reporting(E_ALL);
/* Add redirection so we can get stderr. */
$handle = popen('/path/to/executable 2>&1', 'r');
echo "'$handle'; " . gettype($handle) . "
";
$read = fread($handle, 2096);
echo $read;
pclose($handle);
?>
NOTES
Note
If you're looking for bi-directional support (two-way), use proc_open(3).
Note
When safe mode is enabled, you can only execute files within the safe_mode_exec_dir. For practical reasons, it is currently not
allowed to have .. components in the path to the executable.
Warning
With safe mode enabled, the command string is escaped with escapeshellcmd(3). Thus, echo y | echo x becomes echo y | echo x.
SEE ALSO pclose(3), fopen(3), proc_open(3).
PHP Documentation Group POPEN(3)
is there a way to find the process id of a process because i have same process invoked several times.
when i need to kill them, i get confused with the id.
Thanks,
sskb
:( (8 Replies)
signal in process communication:
I 'm a example in sun_unix that signal in process communication
It's here down but I only have freebsd in my machine.
how can i do the same in freebsd
eg:
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
int
main( void ){
void... (2 Replies)
When I run the top command, it shows 1 process as being Stopped. This is not a zombie, but simply a stopped process. Unfortunately, I can't figure out how to tell which process this is, nor why it is in a stopped state? Any way of finding this out? (7 Replies)
I want to have a script to terminate the system process that generated by user oracle_usr and have already processed for over 10 minutes , could suggest the script ? thx (1 Reply)
We have a system user "oracle_usr" always run some process in the system , but sometimes , these processes will not stop automatically until we terminate the process , can suggest the method how to terminate the process that is run by "oracle_usr" and run over 10 minutes ? thx (5 Replies)
I have a process to terminate, and when keying Control C/ kill -int , it takes 15 minutes to half an hour to terminate the process. I've tried using kill -2, or keying control c twice, however the process seem
to be killed abruptly, without writing into the log file.
So the only way in order to... (8 Replies)
Hi,
My server has disabled exec() of PHP, but they still left proc_open() available for the task. The problem is, I don't know how to use proc_open()!
I just want to simulate exec() with proc_open(), so can someone write a little script such as exec_alternative() that works as exec() but uses... (2 Replies)
Is there a way to tell for sure if a file currently is opened by any running process?
I have a task to filter a text file which is produced by some long process.
I have no way to communicate with that process, but I have access to a location, where that proces produce an output file.
Need... (3 Replies)
hi to everyone reading,
I have an assignment, I should make a process that should start a second process, and reseiving a signal from it to create a third process and close the second one... and the other things i will do on myself :)
Do you have an Idea ?:confused: (2 Replies)
I have one process which is supposed to run 24 x7, However, it was down a couple of times since yesterday. Can anyone please tell me how to investigate this issue? (I have changed the box and process name.)
root@mybox:pwd
/etc/init.d
root@mybox:./abcd start
eTrust Audit r8.0 (102.5)... (2 Replies)
Hi,
How can I terminate process using vbscript. PLEASE NOTE, I need to terminate process that runs under windows 64-bit environment as native 64 (not using select * from win_32_Process) (3 Replies)
Hello Group,
We want to create a script in order to filter process in the system with more than five days (STIME) and then kill them under Solaris 10.
How can we filter these kind of process ?
ps -efa
Thanks in advance for your help (4 Replies)