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 #185190 is a reply to message #185189] Fri, 07 March 2014 15:36 Go to previous messageGo to previous message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma:
Senior Member
The Natural Philosopher wrote:
^^^^^^^^^^^^^^^^^^^^^^^
Please fix.

> On 07/03/14 14:09, Thomas 'PointedEars' Lahn wrote:
>> bishop2001 wrote:
>>> 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);
>>> ?>
>>
>> Even if a Web server would serve that resource, it would not execute it
>> by default, IOW by default you would receive only the source code of the
>> shell script, not its output.
>
> The way to do this is to set php up on the remote server to have a web
> page run that script.
>
> e.g. on the machine2 that runs a script have a php file that does this
>
> echo (exec('script.sh'));
>
> and then on machine1 simply use curl to point not at the script, but at
> the URL of the php file that actually runs that script.

That is not the only way.

Your From header field still violates RFC 5536, and several other
conventions and rules.

Learn to quote.


PointedEars
--
When all you know is jQuery, every problem looks $(olvable).
[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: Mon Nov 25 00:05:38 GMT 2024

Total time taken to generate the page: 0.06960 seconds