1.11M Members

Need to launch a daemon on a server with a JQuery Ajax call (LINUX PHP5)

 
0
 

I am trying to start a daemon on a server with Ajax PHP and JQuery. The following code executes without any errors an opens all the html files in separate browser windows like it's supposed to. I receive the alert message . However, the daemon never starts. Can anyone see what is wrong with the code?

Server side php file:

filename: executedp.php

<?php
$startDaemon = exec('sh ~/.devilspie/ruleset.sh $x; done');
?>

Client side JQuery Code:

if(found) {
                        //call to start daemon
			var xhr = $.ajax({ 
			url: 'executedp.php',
 			success: alert("It has begun!")  
			}); 
		
			switch($.tableCount) {
			
			case ($.tableCount = 1):
			window.open('table1.html');
			xhr;
			break;			
			
			case ($.tableCount = 2):
			window.open('table1.html');
			window.open('table2.html');
			xhr;
			break;
			
			case ($.tableCount = 3):
			window.open('table1.html');
			window.open('table2.html');
			window.open('table3.html');
			xhr;
			break;

			case ($.tableCount = 4):
			window.open('table1.html');
			window.open('table2.html');
			window.open('table3.html');
			window.open('table4.html');
			xhr;
			break;
			}
            }

I have researched for hours and to high heaven for a resolution. Any suggestions greatly appreciated.

 
0
 

Are you sure that the web user (which runs PHP) has rights to start an external application ?

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: