Jump to content

Recommended Posts

Does entering:

'C:\Program Files\FileZilla Client\filezilla.exe'

At the command line work?

 

Also, try:

$exec = "'C:\Program Files\FileZilla Client\filezilla.exe'";

if (exec($exec)) {

...

}

else {

...

}

 

Someone had a problem like that and I told them to try it and it worked.  I don't know why, honestly.

@DarkWater: Actually i am running this for test.that just choose filezilla from c drive to run.

@thorpe: Yup,PHP script is running via apache.

Ok,in brief:

I make a script for our client,for whom we buy a dedicated server running debian on it.

That script will send sms to the client when there is overflow by some level in the real monitoring sensors.Now

i cron that file to run after 2 minutes,if there are some values in the table which are greater than the mentioned level,so pick the

specific data and send them to the client.

Now the server is difinitly running LINUX,so i have to run it under linux.

Now WHY i want to run a application through that script,i want to pass some arguments to new script(maybe in c or c++) to accept entries and then send that entries to client.the another script is used for sending sms and recieving arguments from the 1st script.

So the another script will run,which will then pass the data to a GSM modem,and modem will send sms.

IS there any better idea to do this.

So mean job for this script is to run a application OR script in other lang and pass them some arguments.

 

As i mention,i am running now a gui just for test.

But i am sure later i think will use some other lang script to use.and i hope our another programmer has a script in C++ for GSM modem to send sms.

There are also other ways to send sms,i am just learning and working on it.to find a better solution for it to send sms.

Two ways i know are:

1) use any other site as Gateway

2) Or use the mobile operator as email reciepionest like:

1234566@vodafone.com

 

 

Haha,yup thorpe you are right there is no one to see the program.

i have  simple idea about a java file in linux based distro by using exec in php.

like:

<?php
exec('java -Xmx32m -jar "/home/blahblahblah/mydomain/testjava/Test.jar"');
?>

And i hope C,C++ will be the same.

How to pass arguments in it,any idea.

Hmm.. you can't really launch applications (like mentioned above) although you can pretty much do all the commands command prompt allows

 

Example

<?php
// output netstat
$e = exec('netstat -n',$out);

var_dump($out);
// stops and starts mysql service
$n = exec('NET STOP MYSQL',$out2);
$n = exec('NET START MYSQL',$out2);

var_dump($out2);
// your system's information, takes a little while and uhh.. only for windows
$system = exec('systeminfo',$info);

var_dump($info);

 

hope that helps!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.