470,864 Members | 1,989 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,864 developers. It's quick & easy.

running startup scripts at server startup?

I was wondering if PHP has some type of initialization functionality
at startup where I can run a script when the web server first boots
up?

I have an Apache server running PHP, and I would like whenever my web
server restarts to clean up some tables that have temporary
information in it.

I have searched through my PHP books and tried Googling, but as you
can imagine, most hits are about the apachectl startup script which is
not what I'm looking for.

Any help would be greatly appreciated!

Thanks,

Terry
Jul 17 '05 #1
2 2315
it would be best to put a link to your script in /etc/crond.daily/ rather
than when your server restarts, really how often does your server restart,
min restart about once every year.

--
Mike Bradley
http://www.gzentools.com -- free online php tools
"T Stoneman" <ts********@hotmail.com> wrote in message
news:23**************************@posting.google.c om...
I was wondering if PHP has some type of initialization functionality
at startup where I can run a script when the web server first boots
up?

I have an Apache server running PHP, and I would like whenever my web
server restarts to clean up some tables that have temporary
information in it.

I have searched through my PHP books and tried Googling, but as you
can imagine, most hits are about the apachectl startup script which is
not what I'm looking for.

Any help would be greatly appreciated!

Thanks,

Terry

Jul 17 '05 #2
On 2004-01-29, T Stoneman <ts********@hotmail.com> wrote:
I have an Apache server running PHP, and I would like whenever my web
server restarts to clean up some tables that have temporary
information in it.


I'm using debian overhere, so all my startup scripts are in /etc/rcX.d/
(with X the runlevel). Actually those directories only containt symlinks
to /etc/init.d/scripts

So if i wanted something that is being called when apache is started,
i'd edit /etc/init.d/apache and add a call to the script in the start
section.

But that requires that nobody is using apachectl directly.

--
http://home.mysth.be/~timvw
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Peter Otten | last post: by
4 posts views Thread by tshad | last post: by
24 posts views Thread by Mark | last post: by
1 post views Thread by walterbyrd | last post: by
22 posts views Thread by V S Rawat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.