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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP without browser

Status
Not open for further replies.

Roland

Programmer
Jul 29, 1999
43
DE
It may sound silly first: is there a way to
start a php script without(!) a browser?
(I want to set some variable-controlled mySQL-
statements as watching-dog process)

Thanks, Roland.

 
Well if you are using Windows, you can just put your scripts into your directory that has PHP installed and then from your commmand prompt, do c:php>php file.php and it should run in there.

If you are wanting to do mysql commands, couldn't you use Telnet or DOS to do it through there?

Hope this helps,

-Vic vic cherubini
vikter@epicsoftware.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director
====
 
If you install PHP as a CGI program instead of as an Apache or ISAPI module, then PHP scripts can be run from the command line just like any other shell script.

This is easier to do in a Unix setting, I believe.

Also, in a Unix setting, you can just use a couple of command-line browsers or browser-emulation tools to run web-based scripts. Lynx is the de facto standard Unix command-line browser, but "wget" (simple) and "curl" (more complex)are a couple of very interesting utilities for "pretending" to be a web browser while really downloading files or running web-based commands.

For your situation, for example, if you are using Unix you could create a bash script, that calls Lynx and tells it to go to a certain PHP page and then do nothing with the results, since it is the PHP page that you actually want to do something. This bash script could be run regularly as a cron job.
 
Yo! I am using a Linux box, of course.
Thanks u 2, thanks rycamor, excellent tip, I will try it out with the command-line-browsers.
Roland.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top