Hi,
I have a need to start the Apache service with a parameter so that I can later access that parameter via PHP. Is this possible?
Hi,
I have a need to start the Apache service with a parameter so that I can later access that parameter via PHP. Is this possible?
Based on the comments on your question, I'd say that using shared memory is an acceptable alternative. Take a look at shmop_open()
et alia.
the httpd program will take a 'directive' when you start it up using -c, so experiment with that and SetEnv.
pass the parameter to httpd with the -C
or -c
(process the configuration directive before/after reading config files) command line option and the SetEnv
directive:
httpd -C "SetEnv FOO bar"
FOO
can now be accessed from PHP like so:
<?php
print getenv('FOO');
prints
bar