Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

proc_terminate(3) [php man page]

PROC_TERMINATE(3)							 1							 PROC_TERMINATE(3)

proc_terminate - Kills a process opened by proc_open

SYNOPSIS
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 pointer

SYNOPSIS
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)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

finding process id

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)
Discussion started by: sskb
8 Replies

2. Programming

signal in process communication

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)
Discussion started by: a9711
2 Replies

3. UNIX for Dummies Questions & Answers

top shows stopped process

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)
Discussion started by: IrishRogue
7 Replies

4. Shell Programming and Scripting

terminate process

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)
Discussion started by: ust
1 Replies

5. Shell Programming and Scripting

Terminate process

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)
Discussion started by: ust
5 Replies

6. UNIX for Advanced & Expert Users

Interrupt signal Control C takes too long to terminate a process

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)
Discussion started by: paqui
8 Replies

7. HP-UX

How to get the opened files by a process

Hi, i'd like to get the files which are opened by a process during his execution using the c language. Thanks for helping me. (2 Replies)
Discussion started by: benoit.gaillard
2 Replies

8. UNIX for Advanced & Expert Users

proc_open

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)
Discussion started by: rayne
2 Replies

9. Programming

command to terminate

hi all how to terminate command eecution process. can you please show me the way thank you (2 Replies)
Discussion started by: munna_dude
2 Replies

10. Shell Programming and Scripting

How to recognize if a file still opened by any process?

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)
Discussion started by: alex_5161
3 Replies

11. UNIX for Dummies Questions & Answers

which process writes to file

Some process rewrites a file ( i'm hacked :) Can I somehow monitor which process does that? (2 Replies)
Discussion started by: hachik
2 Replies

12. Programming

1 process should co-ordinate another 10

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)
Discussion started by: stenlyto
2 Replies

13. Solaris

how to troubleshooting if one process is down unexpectly

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)
Discussion started by: uuontario
2 Replies

14. Windows & DOS: Issues & Discussions

Kill a process

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)
Discussion started by: cratercrabs
3 Replies

15. Shell Programming and Scripting

Cancel process running for more than 5 days

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)
Discussion started by: csierra
4 Replies