Answer the question
In order to leave comments, you need to log in
Why does the Instagram upload script take a long time to complete?
Hello, please tell me why the script for unloading from instagram takes a long time to complete? That is, just after I call this script, the loading on the tab spins for a long time, but then eventually it stops spinning and no errors appear
. And in the script itself, only the modx API connection and the file_get_contents function are executed
define('MODX_API_MODE', true);
define("FILLE_GAL","assets/template/API/gal/gal.json");
require_once($_SERVER['DOCUMENT_ROOT'].'/index.php');
$modx=new modX();
$modx->initialize('web');
/* include MODX_API END */
define("FILLE_GAL","assets/template/API/gal/gal.json");
define("ACCESS_TOKEN","....");
$jsonElem = file_get_contents("https://api.instagram.com/v1/users/self/media/recent/?access_token=".ACCESS_TOKEN);
Answer the question
In order to leave comments, you need to log in
The execution time of the request to the Instagram API itself can be controlled directly, for example, via cURL:
curl -v -o " https://api.instagram.com/v1/users/self/media/rece... "
The fact that the script itself is nothing does not output, possibly indicates that the connection is being disconnected by timeout (either the timeout of PHP itself or the timeout of the web server). For the first, you need to look at the value of the max_execution_time parameter in php.ini (default is 30 seconds), the second depends on the type of web server.
Also, a "blank" page is quite possible if a fatal error occurs, and the output of error messages is turned off. You need to look in the PHP error log (which may need to be enabled beforehand) or temporarily enable error display via ini_set('display_errors',
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question