dongzhanyan3667 2015-10-12 20:01
浏览 141

PHP脚本在~60秒后重置并重新开始

I have an Opencart site that I'm trying to export products from using a module. The server is set up using nginx/php5-fpm/mariadb. When I run my export the timer gets to around ~60 seconds and then restarts over and over again.

I've checked several php settings such as:

max_execution_time 120

max_input_time 120

max_input_vars 25000

memory_limit 512M

Nothing shows up in the logs either. What could I be missing?

ANSWER:

My token session was being reloaded via java script to keep the admin session active. This was interfering with the connection of the php script being executed as a module through OC.

  • 写回答

2条回答 默认 最新

  • duanci1939 2015-10-12 20:10
    关注

    I'm not sure why the script is stopping but what I use to run a php script for long time is :

    <?php
    set_time_limit(0);
    ignore_user_abort(true);
    //the rest of the code...
    

    set_time_limit

    Set the number of seconds a script is allowed to run. If this is reached, the script returns a fatal error. The default limit is 30 seconds or, if it exists, the max_execution_time value defined in the php.ini.


    ignore_user_abort

    Sets whether a client disconnect should cause a script to be aborted. When running PHP as a command line script, and the script's tty goes away without the script being terminated then the script will die the next time it tries to write anything, unless value is set to TRUE


    TIP

    You may want to enable error reporting to check if the script contains any errors, i.e.:

    <?php 
    error_reporting(E_ALL); 
    ini_set('display_errors', 1);
    
    评论

报告相同问题?

悬赏问题

  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输