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

PHP script at start up

P: n/a
I would like to run a script at startup under SuSE 9. I read and
figured out that it can be done using chkconfig and setting the proper
run level. The problem I have currently is that I depend on system
environmental variables being available for PHP. I am using PHP as a
scripting language (nothing to do with the web), and this PHP script
is called from the start up bash script, but it cannot retrieve any
environmental vars at runlevel 3.

When are environmental vars set and at which runlevel? Or should I do
this some other way?

Thanks,

Slawek

Feb 8 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Thu, 08 Feb 2007 08:39:22 -0800, Slawek wrote:
I would like to run a script at startup under SuSE 9. I read and
figured out that it can be done using chkconfig and setting the proper
run level. The problem I have currently is that I depend on system
environmental variables being available for PHP. I am using PHP as a
scripting language (nothing to do with the web), and this PHP script
is called from the start up bash script, but it cannot retrieve any
environmental vars at runlevel 3.

When are environmental vars set and at which runlevel? Or should I do
this some other way?

Thanks,

Slawek
$ php -r 'echo getenv("ORACLE_HOME"),"\n";'
/oracle/product/10g
$
--
http://www.mladen-gogala.com
Feb 9 '07 #2

P: n/a
Slawek wrote:
When are environmental vars set and at which runlevel? Or should I do
this some other way?
Different environment variables are set at different stages. Many of the
good ones are not set until you log in.

What information do you need to find out from environment variables?
Perhaps there is another way of finding it.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Feb 9 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.