PHP script is killed without explanation

前端 未结 5 642
失恋的感觉
失恋的感觉 2021-01-19 17:22

I\'m starting my php script in the following way:

bash  
cd \'path\'   
php -f \'scriptname\'.php

There is no output while the php script i

5条回答
  •  [愿得一人]
    2021-01-19 17:40

    Your process is killed. There could be a multitude of reasons, but it's easy to discard some of the more obvious.

    • php limits: if you run into a php limit, you'll get an error in the logfile, and probably on the commandline as well. This normally does not print 'killed'
    • the session-is-ended-issues: if you still have your session, then your session is obvioiusly not ended, so disregard all the nohup and & stuff

    If your server is starved for resources (no memory, no swap), the kernel might kill your process. This is probably what's happening.

    In anycase: your process is getting send a signal that it should stop. Normally only a couple of 'things' can do this

    • your account (e.g. you kill the process)
    • an admin user (e.g. root)
    • the kernel when it is really needing your memory for itself.
    • maybe some automated process, for instance, if you live on a shared server and you take up more then your share of resources.

    references: Who "Killed" my process and why?

提交回复
热议问题