LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-31-2005, 03:46 PM   #1
bwreath
LQ Newbie
 
Registered: Jul 2003
Posts: 16

Rep: Reputation: 0
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!
 
Old 04-01-2005, 03:15 PM   #2
huibert.alblas
Member
 
Registered: Jan 2004
Location: Duesseldorf /Germany
Distribution: Gentoo amd64 / Debian
Posts: 226

Rep: Reputation: 30
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)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling shell scripts from PHP as other users Thin Programming 1 12-02-2005 08:17 AM
How do I stop services from restarting after I stop them? M$ISBS Linux - Software 3 10-27-2005 08:13 PM
odd recursion: calling "by hand" vs calling by cronscript... prx Programming 4 02-12-2005 04:59 PM
calling mplayer -identify via php script? bai_design Programming 8 01-27-2005 01:37 PM
Calling a Php file from CRON every hours ? airbuzz *BSD 10 02-03-2004 02:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration