Bonjour,
au fait, je bosse sur la mise en place d'un serveur web (apache) sous RHEL 4. je m'y connais pas assez en PHP et HTML
il m'a été donné un index.php (code php, dont je vous ferai voir le contenu plus loin )qui parait-il lorsqu'il sera lancé à partir de la barre d'adresse de n'importe kel naviguateur en local devrait soit redemarrer , demarrer , ou stopper l'application. IL fo mentionner ken ligne de commande , l'application s'execute correctement. Parait il ke ce code en PHP devrait executer des instructions d'un script shell (dont vs verrez aussi le contenu). Pour me résumer, il faut qu'à la demande de index.php , le serveur puisse executer (demarrage , stop.......).
Je n'ai donc pas ce resultat mais sur ma page n'affiche que ceci ;
Shutting down smsbox (kannel 1.4.1): Shutting down bearerbox (kannel 1.4.1):
Starting bearer service (gateway kannel 1.4.1): Starting smsbox service (gateway kannel 1.4.1):
bienque le serveur ne respectant pas le statut affiché:
code php
<?php
$ligne = system('smsicomd stop ');
echo " $ligne <br> ";
$ligne1 = system('smsicomd start');
echo $ligne1;
?>
script shell
#!/bin/sh
#
# smsicomd This shell script takes care of starting and stopping
# the Kannel WAP gateway (bearer/wapbox)
#
# chkconfig: 2345 97 03
# description: Start and stop the Kannel WAP gateway used to fetch \
# some WML content from a Web server & compile it \
# into WMLC mobile phone bytecode.
# probe: true
# Use start-stop-daemon
ver=1.4.1
BBOX=/usr/local/sbin/bearerbox
SBOX=/usr/local/sbin/smsbox
START="/usr/local/sbin/start-stop-daemon --start --background --quiet --exec"
STOP="/usr/local/sbin/start-stop-daemon --stop --quiet --oknodo --exec"
CONF=/etc/kannel/kannel.conf
[ $# -eq 2 ] && ver=$2
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -x $BBOX ] || exit 0
[ -x $SBOX ] || exit 0
[ -f $CONF ] || exit 0
RETVAL=0
smsicomd
sleep 1 # Sleep for a while before we try to start smsbox
echo
echo -n "Starting smsbox service (gateway kannel $ver): "
$START $SBOX -- $CONF
RETVAL2=$?
echo
echo
[ $RETVAL1 -eq 0 -a $RETVAL2 -eq 0 ] && touch /var/lock/subsys/smsicomd ||\
RETVAL=1
;;
stop)
# Stop daemons.
echo -n "Shutting down smsbox (kannel $ver): "
$STOP $SBOX
RETVAL2=$?
echo
echo -n "Shutting down bearerbox (kannel $ver): "
$STOP $BBOX
RETVAL1=$?
echo
[ $RETVAL1 -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /var/lock/subsys/smsicomd
echo ""
;;
status)
status bearerbox
status smsbox
exit $?
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: named {start|stop|status|restart}"
exit 1
esac
exit $RETVAL
Configuration: Linux Red Hat
Firefox 1.0Configuration: RHEL4
Firefox 2.0.0.20

