How to make php script run another php script

前端 未结 9 1334
小蘑菇
小蘑菇 2021-02-07 15:45

I\'m trying to do exactly the same thing as in my previous Python question, but in PHP. See my previous (answered) question

PHP script from previous question does someth

9条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-07 16:04

    If your remote script is accessible as simple webpage via http, you might try variant with http get request where response timeout set to minimal time for example via CURL:

    if( $curl = curl_init() ) {
      curl_setopt($curl, CURLOPT_URL, 'http://your_site/your_script.php');
      curl_setopt($curl, CURLOPT_TIMEOUT, 1);
      curl_exec($curl);      
      curl_close($curl);
    }
    

    but so you will have delay in 1 second in the your first script execution.

提交回复
热议问题