[PHP] Re: Executing a php script periodically using crond

2002-07-02 Thread Henry

PS. I cannot compile as a binary etc. This configuration is the confi of the
shared server I am using which is hosted by a third part.

Henry



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Executing a php script periodically using crond

2002-07-02 Thread Jason Wong

On Wednesday 03 July 2002 00:25, Henry wrote:
 PS. I cannot compile as a binary etc. This configuration is the confi of
 the shared server I am using which is hosted by a third part.

This has been covered many times in the past as a quick search of the archives 
would reveal.

If you don't have PHP compiled as CGI then your only recourse is to use 
something like lynx to run your script.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
No, I don't have a drinking problem.

I drink, I get drunk, I fall down.

No problem!
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Executing a php script periodically using crond

2002-07-02 Thread Erik Price


On Tuesday, July 2, 2002, at 12:25  PM, Henry wrote:

 PS. I cannot compile as a binary etc. This configuration is the confi 
 of the
 shared server I am using which is hosted by a third part.

If your PHP is not compiled as a CGI interpreter, then you can't do 
commandline PHP commands.  But all is not lost.  You can have the cron 
job execute a shell script that executes lynx or links or wget, or even 
just executes the command directly from the cron job, and have that 
lynx/links/wget request a PHP script that does what you want done.


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Executing a php script periodically using crond

2002-07-02 Thread Henry

Thanks,

Only one concern. Are there any security issues. And I suppose more
importantly, if there are; is there a way to get the php-script to ensure
that is is being invoked by my cron deamon. Should I put the page in a
directory and use .htaccess to control security. Or can I check the referrer
to ensure that it is not being invoked via a browser!!

I'm going to go down the wget path at the moment. Thanks in advance.

Henry

Erik Price [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 On Tuesday, July 2, 2002, at 12:25  PM, Henry wrote:

  PS. I cannot compile as a binary etc. This configuration is the confi
  of the
  shared server I am using which is hosted by a third part.

 If your PHP is not compiled as a CGI interpreter, then you can't do
 commandline PHP commands.  But all is not lost.  You can have the cron
 job execute a shell script that executes lynx or links or wget, or even
 just executes the command directly from the cron job, and have that
 lynx/links/wget request a PHP script that does what you want done.


 Erik




 

 Erik Price
 Web Developer Temp
 Media Lab, H.H. Brown
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Executing a php script periodically using crond

2002-07-02 Thread Chris Hewitt

Henry,

lynx --dump http://www.domain.com/myfile.php

man lynx for details. You can run it from cron.
HTH
Chris

Henry wrote:

PS. I cannot compile as a binary etc. This configuration is the confi of the
shared server I am using which is hosted by a third part.

Henry






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Executing a php script periodically using crond

2002-07-02 Thread Erik Price


On Tuesday, July 2, 2002, at 01:00  PM, Henry wrote:

 Only one concern. Are there any security issues.
 And I suppose more
 importantly, if there are; is there a way to get the php-script to 
 ensure
 that is is being invoked by my cron deamon. Should I put the page in a
 directory and use .htaccess to control security. Or can I check the 
 referrer
 to ensure that it is not being invoked via a browser!!

There are always security issues.  I have no idea about the details of 
your system, your needs, or anything else, so I can't tell you anything 
except to think logically about what you are doing.  Does taking the 
wget path mean that anybody can use links/lynx/wget/telnet/Internet 
Explorer/Mozilla to execute your script?  Most definitely.  Be sure that 
you take this into account when you design it (you may wish to check 
things like the User-agent, IP address, and other HTTP variables to make 
sure that it is being executed properly).

 I'm going to go down the wget path at the moment. Thanks in advance.

Good idea -- seems like your only option according to what you've told 
us.

Personally I would probably write a Perl script (most hosts have Perl) 
to do whatever it is that needs to be done and have cron execute that, 
this saves you from a whole window of exploit (the web server).  But if 
you don't have Perl or don't know Perl, that's a problem.


Good luck,

Erik







Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Executing a php script periodically using crond

2002-07-02 Thread Henry

I'm having to learning new languages faster than I'm having hot dinners.
When I say learn I don't mean become some sort of guru, just enough to get
by. If I wanted to do it in perl (and I know this isn't the right newsgroup,
but please excuse me), how would I access a mysql server?

Besides that, its working a treat with wget and php. I'll have a fully
fledged autoresponder system up in no time. Thankyou all.

Henry

Erik Price [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 On Tuesday, July 2, 2002, at 01:00  PM, Henry wrote:

  Only one concern. Are there any security issues.
  And I suppose more
  importantly, if there are; is there a way to get the php-script to
  ensure
  that is is being invoked by my cron deamon. Should I put the page in a
  directory and use .htaccess to control security. Or can I check the
  referrer
  to ensure that it is not being invoked via a browser!!

 There are always security issues.  I have no idea about the details of
 your system, your needs, or anything else, so I can't tell you anything
 except to think logically about what you are doing.  Does taking the
 wget path mean that anybody can use links/lynx/wget/telnet/Internet
 Explorer/Mozilla to execute your script?  Most definitely.  Be sure that
 you take this into account when you design it (you may wish to check
 things like the User-agent, IP address, and other HTTP variables to make
 sure that it is being executed properly).

  I'm going to go down the wget path at the moment. Thanks in advance.

 Good idea -- seems like your only option according to what you've told
 us.

 Personally I would probably write a Perl script (most hosts have Perl)
 to do whatever it is that needs to be done and have cron execute that,
 this saves you from a whole window of exploit (the web server).  But if
 you don't have Perl or don't know Perl, that's a problem.


 Good luck,

 Erik





 

 Erik Price
 Web Developer Temp
 Media Lab, H.H. Brown
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Executing a php script periodically using crond

2002-07-02 Thread Richard Lynch

PS. I cannot compile as a binary etc. This configuration is the confi of the
shared server I am using which is hosted by a third part.

Henry



Get them to do the exact same command, without the apxs part, and put the
resulting php binary in /usr/bin or somewhere handy...

They *PROBABLY* already have it, actually...

Can you SSH in and do:

locate php | less

Look for something like /usr/bin/php or /usr/local/bin/php or /usr/sbin/php
or...

Or, just try this at the command line, and pray:

php -v

If that spits out PHP info (version etc) then you're all set.

-- 
Like Music?  http://l-i-e.com/artists.htm


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php