Operating System - Linux
1822103 Members
3503 Online
109640 Solutions
New Discussion юеВ

Re: "/etc/init.d/httpd start" and "service httpd start"

 
hweehim
New Member

"/etc/init.d/httpd start" and "service httpd start"

Anyone know the different between starting apache via "/etc/init.d/httpd start" and "service httpd start"??

When i try with "/etc/init.d/httpd start", my application work correctly
Butwhen i try with "service httpd start", my PHP application is not able to connect the oracle database.

5 REPLIES 5
Stuart Browne
Honored Contributor

Re: "/etc/init.d/httpd start" and "service httpd start"

On a RH server, the 'service' command is just a wrapper around calling the '/etc/init.d/' script, so for all intent and purpose, they are identical.

Now, when you say your 'PHP application', are you saying that using this method of starting your web server doesn't load the PHP module? Doesn't find the Oracle database plugin into PHP?

Look at the http error log and php's error log, and give us some more details.
One long-haired git at your service...
Alexander Chuzhoy
Honored Contributor

Re: "/etc/init.d/httpd start" and "service httpd start"

/sbin/service is a shell script. Eventually (unless you start it with some special options like status-all), it runs the following:
env -i LANG="$LANG" PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" ${OPTIONS}

Where $SERVICEDIR variable is "/etc/init.d"
$SERVICE is the first argument to the service command. (in case you ran service httpd start - $SERVICE will have httpd)
$OPTIONS is the second argument to the service command (in case you ran service httpd start - $OPTIONS will have start).

Hope this helps.
hweehim
New Member

Re: "/etc/init.d/httpd start" and "service httpd start"

To me it seem to be it "Doesn't find the Oracle database plugin into PHP". that why my application say no connection to database.

There are no error in the http or php error logs
Alexander Chuzhoy
Honored Contributor

Re: "/etc/init.d/httpd start" and "service httpd start"

As long as "/etc/init.d/httpd start" works for you - use it, or check the content of your "/sbin/service" script.
Venilton Junior
Valued Contributor

Re: "/etc/init.d/httpd start" and "service httpd start"

Please check this note on your /etc/init.d/httpd script:

# Set HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd to use a server
# with the thread-based "worker" MPM; BE WARNED that some modules may not
# work correctly with a thread-based MPM; notably PHP will refuse to start.

It starts at line 27.

Plese check if this comment apply to your environment.

Regards
RTFM