Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Process handling with PHP and Apache?

Status
Not open for further replies.

atomix

Programmer
Aug 14, 2002
16
0
0
US
The environment is Windows with Apache/php/mySQL. I have written a bunch of web pages that take user input and stuffs the information into the database. This works fine. But also running on the server is another program that generates a series of text files that I would also like to stuff into the database.

I wrote a web page or two that the user can visit and cause the files to be processed. Again, this works OK. But the problem is that the user sometimes forgets, then the data in the database is not up-to-date.

The grand idea is, through a web page, to be able to start a process that would just continually look for new text files and process them. While this is runnining, I'd like to let the user continue on with their other stuff. Ideally, it would be nice for the user to come back and see status - ie. how many files processed, and when it's time to go home, stop the process that looks for the text files.

The only idea I can come up with is on the server (that's running apache/php/mysql and this other application) is to manually open a dos window and run a php script in that window that just loops looking for these files to read. But that seems kind of kludgy to me, and the user can't do this through a web browser.

Is there a way to do this with with php/Apache on Windows? Hints and pointers to articles greatly appreciated. I'm fairly new at php and apache, but I'm a quick study. Thanks in advance.
 
Hmmm, hadn't thought about that. I'll look into it. What I was hoping to do was to provide the user a web page where they could start this task, then later come back and stop it, which could be whenever they wanted to - this isn't necessarily an 8 to 5 type of a job, but needs to be done when the user is there. Maybe I can schedule a task and it looks for a "go" or "stop" flag in the database, and either runs or doesnt.

Just to clarify, the app doing the processing is mine - its now a couple of php scripts/web pages that scan the text files and processes them, and I'd like to automate this part of the deal so the user doesn't have to remember "oh, time to go see if there's any files..". The app that actually generates the text files is totally out of my control. It just happens to drop these text files that I need to get into the DB in a timely manner.

I was hoping to stir up a conversation about process handling with PHP and throw in the complexity of doing it in a web-based environment, something that I don't know much about, but apparently not a lot of interest in this area.
 
Process control is extraordinarily complicated in a web-based environment because web applications are discontinuous. Unless you use complex client-side programming, such as Java, your web browser spends an overwhelming majority of its time not in communication with a web server.

You can throw in stuff like automatic periodic AJAX updating of a page, but it's still discontinuous.


Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top