By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,313 Members | 1,240 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,313 IT Pros & Developers. It's quick & easy.

running startup scripts at server startup?

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.