Errant Posted April 2, 2007 Share Posted April 2, 2007 Hi, I checked the rest of the forum and I dont think that this was covered before.. Here's quick spec of what I want help with, it involves a game server a remote database server (running PHP 4 and Mysql latest). The problem is - we have a coded plugin for the game server to run a PHP script on the remote server and save some data to the mysql. What I then need to do is send the data back by running a program with a command string on the game server via the PHP. If that nmakes sense. I know you can use exec() locally but unfortunately the data server and game server have to be seperate (or rather we cant get them together ). SO is there a way to execute programs on a remote machine via PHP? I wondered if fsockopen would work but i don't think it would right? Is this even possible? Quote Link to comment https://forums.phpfreaks.com/topic/45265-solved-executing-a-remote-program-help/ Share on other sites More sharing options...
trq Posted April 2, 2007 Share Posted April 2, 2007 SO is there a way to execute programs on a remote machine via PHP? If you have control over both servers its easy enough to just write a php script on the remote server which will execute your program. Then all you need do is make a http request for said script. Quote Link to comment https://forums.phpfreaks.com/topic/45265-solved-executing-a-remote-program-help/#findComment-219787 Share on other sites More sharing options...
Errant Posted April 2, 2007 Author Share Posted April 2, 2007 Hmm yes I was hoping I could do that but the Game server (aka the remote server) doesn't have PHP installed.... Quote Link to comment https://forums.phpfreaks.com/topic/45265-solved-executing-a-remote-program-help/#findComment-219841 Share on other sites More sharing options...
trq Posted April 2, 2007 Share Posted April 2, 2007 Then you'd be out of luck. You can't access programs on a server directly, imagine the security risks. have you got ssh access to the server? You could use php's ssh extension. Quote Link to comment https://forums.phpfreaks.com/topic/45265-solved-executing-a-remote-program-help/#findComment-219844 Share on other sites More sharing options...
Errant Posted April 2, 2007 Author Share Posted April 2, 2007 Aha - that's perfect Precisely what I was looking for but couldn't find. I'll have a play around Quote Link to comment https://forums.phpfreaks.com/topic/45265-solved-executing-a-remote-program-help/#findComment-219863 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.