LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   stop executables and php that is calling it (https://www.linuxquestions.org/questions/linux-software-2/stop-executables-and-php-that-is-calling-it-308330/)

bwreath 03-31-2005 03:46 PM

stop executables and php that is calling it
 
Hi,

I would appreciate help with the following. I am trying to implement a cancel button on in a php application. In this application a person can login to his/her account and access a database.

The PHP file that I am working on contains some input boxes and some pull down lists. According to the user's input and some choices the mypictures.php
will

1) make select statements from the database (I am using MySQL)
2) in a loop has a grep statement that looks for pictures stored in the database
3) call an excutable file called generatepicture and generatepicture also calls another excutable gatherparts

A cancel button will be useful when a user makes a big request and then decides to cancel.

This is a php and linux question as inside my php file there is a loop and inside the look there is a call "system" call that executes a shell script item #3 listed above. Inside this shell script there are serveral calls to execute executables from a third party software

One problem I have is that the php file is rendering itself so I'm not sure where or if the cancel can be placed or if it will be functional on the mypictures.php page. Let us say I have solved this problem with a pop up window that contains the cancel button.

My next linux related problem is that I want to stop the mypictures.php page itself and I want to stop any exectuables is has started.

I plan on having the cancel button redirecting the user to a fresh new page but before redirecting I would like to stop the three processes that I mentionned ie. select statements, grep statement and most importantly the executables that get called in the background.

I have had problems with the server getting tied up because some of the executables kept on running.
How do I stop these processes? Should I or could I use the kill command
if so how would I find the process ID of the original mypictures.php and any of the executables it has called.

Thanks!

huibert.alblas 04-01-2005 03:15 PM

I don't think your problem is easely solvable in php,
(with servlets it might be posible, if you would you a kind of thread manager , still this is not easy)

But I think you should rethink your concept.

Using GREP in a loop with Database queries, cannot be correct.
You should use your Database select statements to do string comparisons, this is an order of a magnitude faster.

If you don't want to "render all graphics after a big query",
maybe you should display a list of matched image names.
Then let the user select which images to render, and render these after a form submit.

As I said, I think you need to rethink your implementation and maybe part of your design.

Here in Germany we would say
Quote:

Du bist auf dem Holzweg.
(you are on the wrong track)


All times are GMT -5. The time now is 06:52 PM.