On one server with centos 5, 32 bit, php 5.3, we have FMS and we want to control it from an external site, we need to restart it sometimes.
we created a file fms-start.sh with the below code
#!/bin/bash
/opt/adobe/fms/server restart
it works, if we login to root of the server and we run this file fms restarts.
then on the same folder /var/www/html
we created a php file restart.php with the below code:
<?php
exec(bash fms-restart.sh);
?>
but it doesn’t work, the error if I run this file on root is
[root@fms3 html]# php restart.php
PHP Parse error: syntax error, unexpected T_STRING in /var/www/html/restart.php on line 2
this may be very simple, I am not a php coder, I’m just a server administrator, Linux, cpanel, ffmpeg, red5, wowza and fms, so my apologies, if I’m asking a real stupid question.
As an administrator I’m sure you’re aware that allowing command line execution of commands at the application layer opens up the server and possibly the entire network to security vulnerabilities. right? So I’m assuming proper precautions have been taken to mitigate the security vulnerabilities of allowing this.
yes, it will be on a protected directory. with a number of security layers.
your code improved the situation, if I run the file on shell:
[root@fms3 html]# php restart.php
the fms restarts, but if I call it on the browser nothing happens.