/    Sign up×
Community /Pin to ProfileBookmark

PHP for…exe-like program (locally installed)??

I’m developing a tool for a friend. Im using PHP+MySql to check that all the url’s in a database are online.

But now the friend tells me he doesnt want this tool to be on a public server, but installed on his server. He doesnt want the list of his sites to be anywhere but on his own machine.

Is there a way to create an installer that installs on my friend’s machine xampp+mysql+my script, making it all like a package?

Please dont say the word Java.

Is there another way of doing so without xampp on his machine?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@eval_BadCode_Nov 21.2011 — I just skipped to the end because a full AMP install for a single script is outrageous.

At the very least you can trim that down to a MP. You obviously need PHP, since that's what you wrote the script in, and you obviously need MySQL since that's what his data has been stored in.

PHP is not just for serving up web pages. That was its original intent, but it has grown to include a GTK (a window environment), and a client ( C:>php checkdatabase.php ).

People seem to think that all PHP is on the web and can be accessed with a URL. That is just plain incompetence. :p
Copy linkTweet thisAlerts:
@gilyotinaauthorNov 22.2011 — So what do I need to do in order to "install" my php-based program on my friends computer?

And is there a way for creating scheduled tasts (windows) based on parameters he gives in the program?

Say he gives a list of url's, and for each url he gives aparameter - how often the script should be executer per that url.

Can i create a scheduled task based on that input?
Copy linkTweet thisAlerts:
@eval_BadCode_Nov 22.2011 — So what do I need to do in order to "install" my php-based program on my friends computer?
[/QUOTE]

Install PHP


And is there a way for creating scheduled tasts (windows) based on parameters he gives in the program?
[/QUOTE]


Yes


Say he gives a list of url's, and for each url he gives aparameter - how often the script should be executer per that url.
[/QUOTE]


You mean he gives the script two parameters?


Can i create a scheduled task based on that input?
[/QUOTE]


Yes.

To be more specific, I believe you will need to reference your operating system's "scheduled tasks" documentation. But I would bet you the most likely way this will go down is like this:

open command prompt as Admin (yikes!, but I think scheduled tasks require admin privilidges). If you don't need to be admin to schedule these tasks, don't run it as Admin.

your PHP will likely look something like this:

[code=php]

list($url,$seconds) = explode(fget_stream(INPUT));
//INPUT is a resource containing the stream (in *nix)... it's similar to a file's handle you would get with fopen
//you may not be able to read it as a stream in windows... you will need to test

//do some validation on $url and $seconds;

$phpCommand = "php /php/urlScript.php"

$cmdString = "C:>Windows/TaskMan/TaskMan.com %s %s %d"; //this is completely phony, I doubt its this, but hey--- it might be! looks legit
$cmdString = sprintf($cmdString,$phpComand,$url,$seconds); // do use the "escape arguments for exec" function... its in the documentation on php.net somewhere
exec($cmdString,$output);

printf("Result -------- n%s",implode($output);

[/code]


You will have to do some research.

Edit... I think if you press F12 or something (the help menu in windows) you can get most of the Scheduled Tasks crap u need to know... *shrug* or use your search engine of choice.
×

Success!

Help @gilyotina spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...