Jump to content

Running External Scripts


kormie

Recommended Posts

I am very new to PHP and am not even sure what I'm asking is possible.  I have just installed mediaWiki on my site and I'm trying to install some extensions.  In order to install the Search functionality extension I have to run some scripts.  Since it's not my server I wanted to use php to execute these Unix Executable Files that came with the package. Do I use system('file_name')? and browse to the site I have with this php within it?  These are probably really lame questions, and I apologize design is more my forte and I'm just now learning the language.  Thanks for any help!

Link to comment
https://forums.phpfreaks.com/topic/177498-running-external-scripts/
Share on other sites

Let me see if I understand you correctly:

 

-You have some programs on server A.

 

-On server B you need to run a program on server A, as if it was local to server A.

 

Is that the question?  If so, no, that can not be done by PHP or any other language.

Along with system() there's also the backtic, which allows you get back the results from standard out into a php variable.

 

$ret = `someprog`;

 

But as thorpe stated, you will only be able to execute programs that the php user can execute, unless you're using the command line php interpreter, but to do that you'd need to be in a shell, where, if that was the case, there's typically not a reason for you to write a php script to run them, when you could just run them directly.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.