Run PHP scripts standalone
Moderator: General Moderators
Run PHP scripts standalone
Is there an interpreter to do that? I have a case in which I have to run a script in a certain time interval (once every three hours), which is being done using cron. I could (of course) code in perl, but I was just wondering if there's some standalone interpreter around.
you might be interested in http://www.php.net/manual/en/features.commandline.php
Maybe you already have /usr/bin/php
If not and if you're not willing to recompile the whole package without any webserver-support (which should by default create /usr/bin/php) you might use lynx -dump http://url.of/script to invoke your script via cron
Maybe you already have /usr/bin/php
If not and if you're not willing to recompile the whole package without any webserver-support (which should by default create /usr/bin/php) you might use lynx -dump http://url.of/script to invoke your script via cron
Ah, thank you. So it will only be possible on systems running the latest version of PHP. Unfortunately the host is running a board system written in PHP (WWWThreads), and as the variable passing has been changed with version 4.2, I fear the whole board system will stop to work, as well as a lot of pages written by different people. Perl it will be then. 
you really should consider an update since some (serious security) fixes took place since then 
http://www.php.net/ChangeLog-4.php and then search for fixed
http://www.php.net/ChangeLog-4.php and then search for fixed
then you're probably stucked with lynx -dump. But calling a script via http://localhost/script.php that is restricted to localhost by <LIMIT ...> in .htaccess should be sufficient 