svcadm apache2

I am trying to setup apache2 with php with oracle funtions enabled in php.

This works with the environment variable LD_LIBRARY_PATH pointing to oracle instant client (other variable I am setting are TNS_ADMIN and ORACLE_HOME).

To get it started when booting I have used

svccfg -s apache2 setenv LD_LIBRARY_PATH $INSTANTCLIENTPATH

plus the other variables.

This worked but set them in the start environment, so when using restart or disable it didn't work instead going into maintenance mode. I then set these enviroment variables in the stop environment also as the svc log file indicated that php couldn't find the oracle client libraries.

svcadm disable apache2still fails running the command again says the service is disabled but apache is still running so when it is enabled it fails due to the port being in use.

This behaviour was confusing me a lot until I worked out what I believe was going wrong.

I am looking for answers as I don't have a great deal of knowlege of how SMF works, the output of svc log indicated when it tries to stop the apache server it tries to load the php library and fails as indicated below

[ Aug 3 14:49:37 Executing stop method ("/lib/svc/method/http-apache2 stop") ]

Syntax error on line 276 of /etc/apache2/httpd.conf:

Cannot load /usr/apache2/libexec/libphp5.so into server: ld.so.1: httpd: fatal: libnnz10.so: open failed: No such file or directory

[ Aug 3 14:49:37 Method "stop" exited with status 1 ]

[ Aug 3 14:51:35 Leaving maintenance because disable requested. ]

[ Aug 3 14:51:35 Disabled. ]

[1633 byte] By [staniforth] at [2007-11-26 9:14:22]
# 1

To reply to my original message, I need to do a

"svcadm refresh apache2"

to enable the new environment variables although they appear when looking at the properties with svccfg.

I must have refreshed after setting the environment variables for the start method but then set the environment variables for the stop method and not done a refresh.

I also found that I needed to set the environment variables for the refresh method (probably only the LD_LIBRARY_PATH required).

staniforth at 2007-7-6 23:38:18 > top of Java-index,Solaris Operating System,Solaris 10 Features...