Jump to content

execute linux program


cucuru

Recommended Posts

hello.

 

I'm trying to execute a linux console with PHP, I tried exec, shell_exec, passthru... but it seems that they can't.

 

I looked the security and this is my answer:

 

-rwxr-xr-x 1 root root 301272 2009-10-20 07:35 "gnome-terminal"

 

so, everybody can execute the console.

 

Maybe the problem is the path:

 

$output = exec('/bin/usr/gnome-terminal');

 

Or maybe it is another problem.

 

Could you help me?

 

Thanks. Regards

Link to comment
Share on other sites

I'm sorry... but I don't see the different between your PHP code and mine...

 

I just want open a console.

 

I found this in error.log in apache2:

 

GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Not running within active session)

 

Configuration server??? I want open it in client side...

 

Thank you

Link to comment
Share on other sites

it isn't possible? do you know how can I do it?

 

ActiveX is just for windows, isn't it?

 

Thank you. Regards

 

even if it were possible, why would a Windows user want to open a console ?

I mean, Linux users most of the time know what a console is...

but I am pretty sure that a webpage that would open a Windows console would freak most of the users out !!

 

what are you trying to get done exactly ?

try to explain that clearly and we might come up with a solution...

Link to comment
Share on other sites

Ok, I'll try explain better.

 

I want opening a console in a Linux client and the server is also a Linux machine.

 

the console exist in the client, I want executing it, the console existing in the client machine.

 

I said the ActiveX because I saw some examples in the web, but I think it's impossible to me use them.

 

Thanks for your time.

 

Regards

Link to comment
Share on other sites

Ok, I'll try explain better.

 

I want opening a console in a Linux client and the server is also a Linux machine.

 

the console exist in the client, I want executing it, the console existing in the client machine.

 

I said the ActiveX because I saw some examples in the web, but I think it's impossible to me use them.

 

Thanks for your time.

 

Regards

 

but why would you want to launch the console on the client's machine ?

What is supposed to happen next ?

Link to comment
Share on other sites

Ok, I'll try explain better.

 

I want opening a console in a Linux client and the server is also a Linux machine.

 

the console exist in the client, I want executing it, the console existing in the client machine.

 

I said the ActiveX because I saw some examples in the web, but I think it's impossible to me use them.

 

Thanks for your time.

 

Regards

 

Yes, It may be possible to run the terminal but what are you attempting to do with it? If you're wanting to run commands such as 'ls /usr/bin' then you need not a terminal, or are you trying to make a direct 'link' to feed it commands?

Link to comment
Share on other sites

I just need open it. The rest of things are latter...

 

You said it is possible, could you say me how, please? I'm trying it for 2 days!

 

Thanks.

 

Regards

 

What do you mean? You cannot use PHP to maintain an active server session with a terminal, all you can do is feed commands to it. There is a thing called SSH that can do this for you, provided you understand in the first place this can't be handled via PHP itself.

Link to comment
Share on other sites

ok, I'm sorry, I had to explain it before...

 

I want open a SSH conection with ssh2 extension of php, and after it open the terminal (with the conection created), I know I can simulate a terminal with ssh2 extension, but I can't do it, my boss forgive it to me.

 

Thank you for your time.

 

regards

Link to comment
Share on other sites

ok, I'm sorry, I had to explain it before...

 

I want open a SSH conection with ssh2 extension of php, and after it open the terminal (with the conection created), I know I can simulate a terminal with ssh2 extension, but I can't do it, my boss forgive it to me.

 

Thank you for your time.

 

regards

 

It's still hard to know what you're wanting to achieve without an example of what you're trying to do with the shell open, but I'm sure you can find your answers. Here's an example use of the SSH2 PHP lib:

http://kevin.vanzonneveld.net/techblog/article/make_ssh_connections_with_php/

Link to comment
Share on other sites

The ssh connection works.

 

Now, I want open a console with this connection, so I don't have to write:

ssh -p xxxx yy.yy.yy.yy

 

and the password, it is done by php.

 

So, I open the console and use it as usual, I just have a lot of connections (ssh and http) and I need to put it together in a web site, because the user don't know the password, and havn't the certificate.

 

Regards

 

Link to comment
Share on other sites

I'll say it again. You cannot open a terminal or any other application on a client using php. End of story.

 

I'll never understand why are people so unpleasant, if you don't want help me, don't do it, don't open this post, but forums are for helping people... so...

 

I know it is not possible do it with php, I asked before if you know how, javascript maybe?

 

Thank you everybody, including thorpe

Link to comment
Share on other sites

I'll say it again. You cannot open a terminal or any other application on a client using php. End of story.

 

I'll never understand why are people so unpleasant, if you don't want help me, don't do it, don't open this post, but forums are for helping people... so...

 

I know it is not possible do it with php, I asked before if you know how, javascript maybe?

 

Thank you everybody, including thorpe

 

I'm not sure what is so unkind about the facts. You asked your question in a php forum and got the appropriate answer as far as I'm concerned.

 

To get further help, you still need to explain why you think you need a terminal, you might not need it at all.

Link to comment
Share on other sites

I'll say it again. You cannot open a terminal or any other application on a client using php. End of story.

 

I'll never understand why are people so unpleasant, if you don't want help me, don't do it, don't open this post, but forums are for helping people... so...

 

I know it is not possible do it with php, I asked before if you know how, javascript maybe?

 

Thank you everybody, including thorpe

 

I'm not sure what is so unkind about the facts. You asked your question in a php forum and got the appropriate answer as far as I'm concerned.

 

To get further help, you still need to explain why you think you need a terminal, you might not need it at all.

 

I'm going to explain you what is so unkind, I'm just answering the questions you did to me, I also asked what can I do if php is not an option... so:

 

I'll say it again. You cannot open a terminal or any other application on a client using php. End of story.

 

Is very unkind.

 

Link to comment
Share on other sites

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.