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

Link to comment
Share on other sites

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.

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.