FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » php exec http url
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: php exec http url [message #185192 is a reply to message #185182] Fri, 07 March 2014 18:12 Go to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On Thu, 06 Mar 2014 12:42:52 -0800, bishop2001 wrote:

> Greetings,
> I am trying to execute a shell script which is residing on a webserver
> on a remote machine with no luck. I have tried the following. It looks
> like it runs but I never see the output from the script on machine2. Any
> suggestions. Thanks,

Firstly, you say "It looks like it runs"

What evidence do you have for this?

> from machine 1:
> echo exec('http://machine2/script.sh);

What entries appear in the webserver logs on the server after attempting
this? You probably want to check any log file in the apache logs dir that
has it's timestamp modified when you try and access the script.

> from machine1:
> <?php $ch = curl_init();
> curl_setopt($ch, CURLOPT_URL, "http://machine2/script.sh");
> curl_setopt($ch, CURLOPT_HEADER, 0);
> curl_exec($ch);
> curl_close($ch);
> ?>

What entries appear in the webserver logs on the server after attempting
this?

Are you sure that the webserver is configured to run .sh files as shell
scripts and pipe the output of the script back to the http session?

Are you sure that the script is executable by the webserver process?
Execute permissions for relevant users / groups / world?

--
Denis McMahon, denismfmcmahon(at)gmail(dot)com
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Experienced Web designer required
Next Topic: When a random file is not found then what?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 13:22:54 GMT 2024

Total time taken to generate the page: 0.04837 seconds