Re: [PHP] me and my CRON JOB

2002-01-11 Thread J Smith


Quick tip -- locate and whereis are your friends in the shell. They make 
finding executables like php are a snap.

As for emailing from php/cron, it depends on how your system is set up. 
Many email servers bounce any emails they receive from IPs that they can't 
reverse map or otherwise identify. If your machine is on a LAN for 
instance, the emails will probably get bounced.

Another thing to check is that your user account can actually use your 
system's SMTP service. Email sent with php's mail() function are usually 
sent by the owner of the script (or the web server's user). 

J



Mehmet Kamil Erisen wrote:

> hi,
> thanks for the tip.  I was wondering about it too
> I do not have access to everywhere on the server.
> I tried /usr/bin/php and it worked.. :)
> 
> I tested the following script for connection to database,
> executing my functions etc...
> everything seems to work but mail.
> any ideas?
> 
> Thanks for the help.
> erisen
> 
> btw: at last, I added the die to my mail command, and fair
> enough, I got the Can not send this as output.
> 
> So, now the question is, how can I send mail with php /
> cron config.
> 
> please note that the script worked fine on the browser.
> thx.
> 
> code:
> #!/usr/bin/php -q
> 
> 
>  
> include ("application.php");
> 
> $subject="Cron Job has run";
> $body="test.php is running now";
> $sendtome = "[EMAIL PROTECTED]";
> mail("[EMAIL PROTECTED]", $subject, $body,$sendtome)
> or die ('Can not send this');
> echo $sendtome;
> echo "hello world";
> 
> echo turk_now() ;
> 
> $array = get_user_stat($CONF) ;
> while (list($key,$value)=each($array)) {
> echo "$key $value";
> }
>
> 
> ?>
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] me and my CRON JOB

2002-01-10 Thread Mehmet Kamil ERISEN

hi,
thanks for the tip.  I was wondering about it too 
I do not have access to everywhere on the server.
I tried /usr/bin/php and it worked.. :)

I tested the following script for connection to database,
executing my functions etc...
everything seems to work but mail.
any ideas?

Thanks for the help.
erisen

btw: at last, I added the die to my mail command, and fair
enough, I got the Can not send this as output.

So, now the question is, how can I send mail with php /
cron config.

please note that the script worked fine on the browser.
thx.

code:
#!/usr/bin/php -q


";
}
   

?>



--- Rasmus Lerdorf <[EMAIL PROTECTED]> wrote:
> Well, does /usr/local/bin/php exist?
> 
> On Thu, 10 Jan 2002, Mehmet Kamil ERISEN wrote:
> 
> > hi,
> > here is the question:
> > I know I need to add a line like:
> > #!/usr/local/bin/php
> > to the begining of my php page followed by
> >  > my code
> > ?>
> >
> > Then set a cron job, so it runs.
> >
> > I have done all that. aslo made the php file
> executable.
> > The file is executing.
> > First I did not put the line #!/usr/local/bin/php
> > and I received an email with error messages.
> >
> > now I added the line with #!/usr/local/bin/php
> > and I am receiving an error message:
> > /bin/sh: /home/webvoire/www/cm/test.php: No such file
> or
> > directory
> >
> > any input?
> >
> > how can I find out the correct #!/usr/bin/... to put.
> is
> > there any way to figure it our from phpinfo();?
> >
> >
> >
> > =
> > Mehmet Erisen
> > http://www.erisen.com
> >
> > __
> > Do You Yahoo!?
> > Send FREE video emails in Yahoo! Mail!
> > http://promo.yahoo.com/videomail/
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> >
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 


=
Mehmet Erisen
http://www.erisen.com

__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] me and my CRON JOB

2002-01-10 Thread Rasmus Lerdorf

Well, does /usr/local/bin/php exist?

On Thu, 10 Jan 2002, Mehmet Kamil ERISEN wrote:

> hi,
> here is the question:
> I know I need to add a line like:
> #!/usr/local/bin/php
> to the begining of my php page followed by
>  my code
> ?>
>
> Then set a cron job, so it runs.
>
> I have done all that. aslo made the php file executable.
> The file is executing.
> First I did not put the line #!/usr/local/bin/php
> and I received an email with error messages.
>
> now I added the line with #!/usr/local/bin/php
> and I am receiving an error message:
> /bin/sh: /home/webvoire/www/cm/test.php: No such file or
> directory
>
> any input?
>
> how can I find out the correct #!/usr/bin/... to put. is
> there any way to figure it our from phpinfo();?
>
>
>
> =
> Mehmet Erisen
> http://www.erisen.com
>
> __
> Do You Yahoo!?
> Send FREE video emails in Yahoo! Mail!
> http://promo.yahoo.com/videomail/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]