Server Side Program to call PHP processes

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ExpertAlmost
Forum Commoner
Posts: 41
Joined: Mon Oct 20, 2008 12:26 am

Server Side Program to call PHP processes

Post by ExpertAlmost »

Good morning!

I need a control program that runs continuously on the server and waits for a time/date/file-found trigger to initiate one of several PHP processes. Each PHP process being initiated requires one or more input variables from the control program: My_PHP_Program(Var1, Var2, Var3). No user/client-side calls (no forms) are made with no HTML output being produced. Each PHP process just generates files which are later accessed by user/client-side page calls in the usual manner.

Can someone provide me with code examples/pointers? (I am assuming that my host site will run Unix/Linux but I will also want to test this locally on my WinXP Apache server.)

Pseude-code example:

My_Control_Program waits for new hour to begin then
On Hour: My_Control_Program calls PHP program: Collect_Data(HourData) to collect hour data and generate a new file: NewHourDataFile
My_Control_Program checks every minute for NewHourDataFile
When NewHourDataFile exists, My_Control_Program calls PHP program: Build_Graphics(NewHourDataFileName) to generate new hour graphics for all users.
My_Control_Program waits/checks ...

Thank you everyone!
internet-solution
Forum Contributor
Posts: 220
Joined: Thu May 27, 2010 6:27 am
Location: UK

Re: Server Side Program to call PHP processes

Post by internet-solution »

You can call php through a cron. See here
ExpertAlmost
Forum Commoner
Posts: 41
Joined: Mon Oct 20, 2008 12:26 am

Re: Server Side Program to call PHP processes

Post by ExpertAlmost »

Thank you! That's a great link.

One thing I do not see is how do I call my php program with inputs when I am not using POST or GET or Forms from the client?

Something like:

My_php_program(var1,var2,var3).php

Thanks!
internet-solution
Forum Contributor
Posts: 220
Joined: Thu May 27, 2010 6:27 am
Location: UK

Re: Server Side Program to call PHP processes

Post by internet-solution »

See references on php.net
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: Server Side Program to call PHP processes

Post by AbraCadaver »

ExpertAlmost wrote:Thank you! That's a great link.

One thing I do not see is how do I call my php program with inputs when I am not using POST or GET or Forms from the client?

Something like:

My_php_program(var1,var2,var3).php

Thanks!
http://us2.php.net/manual/en/reserved.v ... s.argv.php
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Post Reply