The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> PHP Development
|
running background job...
Discuss running background job... in the PHP Development forum on Dev Shed. running background job... PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

November 9th, 1999, 08:54 AM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
Hello again!
Is it possible to get a php3 script to check what day it is, and then do some stuff, If it’s let’s say Monday?
This without you doing anything. Like a background - or cronjob…
I guess you would use perl or something to do this, but that is not an option I have.!.
------------------
-ulrik-
|

November 10th, 1999, 06:14 PM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
Two options:
1) Compile the PHP CGI version (leave off --with-apache from the ./configure command) and then use CRON to run your script.
2) Use cron to call Lynx with the '-dump' command line option and the URL to the PHP page that does the work.
|

November 17th, 1999, 11:34 AM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
Err..
My access level is "user" meaning, I can't recompile anything, I do not have cgi-access... That is my problem.
The only thing I do have access to is php3.
Can you make a php3-script, that "sleeps" for 24 houres "wakesup" checks the date do some other stuff. "sleeps" ...... ect...
------------------
-ulrik-
|

November 18th, 1999, 09:24 AM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
The only way to do this is with a cron job. If your host doesn't allow this you're pretty much SOL.
A tricky alternative is to have this done by your index page (assuming your site is visited fairly often). Program in a time check and if it's past the time you want, include() the script you want run. Now, the first user to visit the index page after the "trigger time" will cause it to be run.
[This message has been edited by rod k (edited 11-18-99).]
|

November 18th, 1999, 04:28 PM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
Damm! I knew it..
Well I just have to convince somebody that it is a good idear, so that I can get my cron job.!.
See Ya'
------------------
-ulrik-
|

November 18th, 1999, 05:45 PM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
Well do you have shell access?? If so, you can compile your own copy of PHP in your home directory and then make cron jobs to run it as the interpreter instead of the system-wide copy of PHP.
|

November 19th, 1999, 02:25 AM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
Nope!
I have wery limited access to the system, meaning:
FTP
I have php3 as the only alternative to html...
------------------
-ulrik-
|

November 19th, 1999, 07:08 PM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
Do you know what type of hardware (Sun, Intel, etc) and what OS (FreeBSD, Solaris, Linux) your ISP runs?
If so, it's not too hard to find someone who'll compile a copy of PHP for you. Then all you should need to do is FTP upload the PHP executable and .ini file to your home directory and call it from there.
If your ISP runs Intel i386/Linux I'd be happy to send you a pre-compiled PHP.
[This message has been edited by jpenix (edited 11-19-99).]
|

November 24th, 1999, 09:38 AM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
Hey
What a fine idear!
My ISP is running Intel with a Debian OS
Is that the info you need to compile a php3 for me.. :-)
But I still have to start the thing... NOT having access to cron jobs, how is that done...?
------------------
-ulrik-
|

November 29th, 1999, 09:55 PM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
Hey Ulrik - Okay, I'm sure I could cough up an executable that'll run on x86 Debian.
Contact me off this board at jpenix@sbtpro.com and let me know what options you want compiled into the PHP (if any), and give me an email I can send the file to.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|