473,385 Members | 1,453 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 2422
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Peter Otten | last post by:
Is there a way to limit both width and height of a canvas text item? My current workaround seems clumsy: import Tkinter as tk root = tk.Tk() canvas = tk.Canvas(root, width=400, height=200,...
8
by: rbt | last post by:
Is there a recommended or 'Best Practices' way of checking the version of python before running scripts? I have scripts that use the os.walk() feature (introduced in 2.3) and users running 2.2 who...
3
by: Sravani | last post by:
Hi, I am setting up a new server for an already running website. The problem is the person before me ran ASP scripts on .html extension pages (The old machine is a windows 2000 server with IIS...
4
by: duzinga | last post by:
I am trying to have a server program that runs at startup and accepts several commands from the clients. One of the commands is to play an audio file. I am using...
4
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
24
by: Mark | last post by:
Hi, I'm new to python and looking for a better idiom to use for the manner I have been organising my python scripts. I've googled all over the place about this but found absolutely nothing. I'm...
1
by: walterbyrd | last post by:
I understand that Python has them, but PHP doesn't. I think that is because mod_php is built into apache, but mod_python is not usually in apache. If mod_python was built into apache, would...
0
by: shaileshkumar | last post by:
hi, iam unable to run my applications in netbeans4.1. problem may be due to JVM or port numbers conflict. i did not intentionally change any port numbers . please guide me accordingly. iam...
22
by: V S Rawat | last post by:
(bringing the discussion here for php.general) I am on xpsp3, wampserver 2.0, having apache 2.2.8, php 5.2.6, MySQL 5.0.51b. http://localhost/ is E:\wamp\www\ I have put the first php script...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.