jlgf
jlgf

Reputation: 307

my php function stops after 30 seconds after running

I have made a function in my Laravel application to send a message to my subscribers when I publish an entry, the problem is that it stops when it goes by the subscriber 28 and does not follow.

I've been researching and it seems that php by default for the script when it takes 30 seconds, I changed the configuration and even the support of my hosting has done for me. But still it is still cutting when it takes about 30 seconds.

Attached image of the php configuration of the cpanel

enter image description here

Upvotes: 0

Views: 704

Answers (3)

Ebin V Thomas
Ebin V Thomas

Reputation: 1

If you are using Cpanel/WHM , go to "MultiPHP INI Editor"(Basic Mode) and select PHP version .

Then edit max_execution_time.

Screenshot attached :

Screen shot

Upvotes: 0

Recigio Poffo
Recigio Poffo

Reputation: 61

Php has a max execution time, you can set a new time limit:

php script

  • ini_set('max_execution_time', 100); //100 seconds
  • ini_set('max_execution_time', 0); // for infinite

htaccess

  • php_value max_execution_time 300

Caution, scripts in an infinity loop will run forever.

Upvotes: 1

pc_
pc_

Reputation: 578

Put that on top of your php script. Just change amount of seconds.

max_execution_time = 10

Upvotes: 0

Related Questions