php-general Digest 27 Jun 2004 15:45:17 -0000 Issue 2844

Topics (messages 189107 through 189113):

Crontab PHP Script
        189107 by: Ryan Schefke
        189108 by: Marek Kilimajer
        189109 by: Scot L. Harris
        189112 by: Tim Traver

Re: image upload woes
        189110 by: Marek Kilimajer

Construction
        189111 by: Jason Davidson
        189113 by: David Goodlad

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hi,

 

Can someone please give me some guidance.  I'd like to run a php script
every minute (in reality every night, but just testing).  I've done some
reading and found that a crontab is the best way to go (I think).  I'm using
Plesk 7 on a Linux box and I have root access.

 

I made a quick php script called crontab.php to email me.

 

==============================================================

<?php                           //send email on domain

                                    /* subject */

                                    $str_subject = "crontab test";

                                    

                                    /* message */

                                    $messagecontent = "this is a test to see
if crontab working nightly\n\n";

                                    

                                    /* to */

                                    $to = "[EMAIL PROTECTED]";

                                    

                                    /* from */

                                    $headers .= "From: tgWedding
<[EMAIL PROTECTED]>\r\n";

                                    

                                    /* bcc */

            //                      $headers .= "Bcc:
[EMAIL PROTECTED]";

                                    

                                    mail($to, $str_subject, $messagecontent,
$headers);

?>

 

 

Then I setup my crontab command as:
/home/httpd/vhosts/tgwedding.com/httpdocs/tgwedding/crontab.php
<https://217.160.251.56:8443/sysuser/crontab_edit.php?cte_src=CTEJKgkqCSoJKg
kvaG9tZS9odHRwZC92aG9zdHMvdGd3ZWRkaW5nLmNvbS9odHRwZG9jcy90Z3dlZGRpbmcvY3Jvbn
RhYi5waHA=> 

 

 

I used " * " for every field except M, which I set to " 01 " to run every
minute.

 

 

It's not working...can someone guide me along and let me know what I've done
wrong.

 

Thanks,

Ryan


--- End Message ---
--- Begin Message --- Ryan Schefke wrote --- napísal::
Hi,



Can someone please give me some guidance.  I'd like to run a php script
every minute (in reality every night, but just testing).  I've done some
reading and found that a crontab is the best way to go (I think).  I'm using
Plesk 7 on a Linux box and I have root access.





Then I setup my crontab command as: /home/httpd/vhosts/tgwedding.com/httpdocs/tgwedding/crontab.php

The crontab command should be:

/path/to/php /path/to/your/crontab.php

Add -q parameter if the php executable is cgi and not cli
--- End Message ---
--- Begin Message ---
On Sat, 2004-06-26 at 19:34, Ryan Schefke wrote:
> Hi,
> 
>  
> 
> Can someone please give me some guidance.  I'd like to run a php script
> every minute (in reality every night, but just testing).  I've done some
> reading and found that a crontab is the best way to go (I think).  I'm using
> Plesk 7 on a Linux box and I have root access.
> 

You need to add #!/usr/bin/php
At the start of your script so it knows how to run it.  You will also
need to set the permission bits to allow execution 
chmod 700

Change the path to where you have the cli version of php on your system.


-- 
Scot L. Harris <[EMAIL PROTECTED]>

--- End Message ---
--- Begin Message --- Not sure if this is different in linux, but usually the first parameter is the minutes, and if you had 01 in it, that means that it would do it once an hour (i.e. 12:01, 1:01, 2:01, etc...

They should all have stars to do it once a minute.

In freeBSD, it would look like this :
* * * * root /usr/local/bin/php home/httpd/vhosts/tgwedding.com/httpdocs/tgwedding/crontab.php


Tim.


At 04:34 PM 6/26/2004, Ryan Schefke wrote:
Hi,



Can someone please give me some guidance.  I'd like to run a php script
every minute (in reality every night, but just testing).  I've done some
reading and found that a crontab is the best way to go (I think).  I'm using
Plesk 7 on a Linux box and I have root access.



I made a quick php script called crontab.php to email me.



==============================================================

<?php                           //send email on domain

                                    /* subject */

                                    $str_subject = "crontab test";



                                    /* message */

                                    $messagecontent = "this is a test to see
if crontab working nightly\n\n";



                                    /* to */

                                    $to = "[EMAIL PROTECTED]";



                                    /* from */

                                    $headers .= "From: tgWedding
<[EMAIL PROTECTED]>\r\n";



                                    /* bcc */

            //                      $headers .= "Bcc:
[EMAIL PROTECTED]";



                                    mail($to, $str_subject, $messagecontent,
$headers);

?>





Then I setup my crontab command as:
/home/httpd/vhosts/tgwedding.com/httpdocs/tgwedding/crontab.php
<https://217.160.251.56:8443/sysuser/crontab_edit.php?cte_src=CTEJKgkqCSoJKg
kvaG9tZS9odHRwZC92aG9zdHMvdGd3ZWRkaW5nLmNvbS9odHRwZG9jcy90Z3dlZGRpbmcvY3Jvbn
RhYi5waHA=>





I used " * " for every field except M, which I set to " 01 " to run every
minute.





It's not working...can someone guide me along and let me know what I've done
wrong.



Thanks,

Ryan


SimpleNet's Back !
http://www.simplenet.com

--- End Message ---
--- Begin Message --- Edward Peloke wrote --- napísal::
I have code which attempts to upload some files and create thumbnails.  The
same code on one server works ok, the same code on another server throws an
error everytime I hit submit that says "The document contains no data"...it
appears to be a javascript error.  It is not an error that I am throwing.
Has anyone ever had this problem?

Thanks,
Eddie


I bet that the script is dying for some reason. Turn display_errors on or check the logs, the real reason should be there somewhere. And it's not javascript.

--- End Message ---
--- Begin Message ---
If you instantiate a child class, the parent class constructor is not
called, is there a reason for this?  anyone know of plans to change
this at all, ....
the obvious workaround is to call the parents constructor inside the
childs constructor, but this seems kinda strange.

Jason

--- End Message ---
--- Begin Message ---
As far as I know, this is fairly common in most programming languages
(but I just woke up so don't take my word on it!).  It allows you a
lot greater control over the construction of your class, since you can
force the child class to override what the parent class's default
member variable values are by calling the parent constructor first, or
you can have it be overridden by the parent by calling the parent
constructor at the end of the child's constructor.

Dave

On Sat, 26 Jun 2004 20:51:58 -0700, Jason Davidson
<[EMAIL PROTECTED]> wrote:
> 
> If you instantiate a child class, the parent class constructor is not
> called, is there a reason for this?  anyone know of plans to change
> this at all, ....
> the obvious workaround is to call the parents constructor inside the
> childs constructor, but this seems kinda strange.
> 
> Jason
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

--- End Message ---

Reply via email to