php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73849 max_execution_time CLI always 0 even php.ini set option to custom value
Submitted: 2017-01-02 04:00 UTC Modified: 2017-01-11 05:07 UTC
From: dophini at dir dot bg Assigned:
Status: Not a bug Package: PHP options/info functions
PHP Version: 7.0.14 OS: debian jessie
Private report: No CVE-ID: None
 [2017-01-02 04:00 UTC] dophini at dir dot bg
Description:
------------
PHP version:
PHP 7.0.14-1~dotdeb+8.1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.14-1~dotdeb+8.1, Copyright (c) 1999-2016, by Zend Technologies

Try to set max_execution_time to custom value bigger than 0. php -i gives max_execution-time always 0

Test script:
---------------
1. editing /etc/php/7.0/cli/php.ini
2. setting max_execution_time to 30 seconds
3. php -i | grep max_execution
shows max_execution_time =0
4. let's see path to php.ini? 
php -i | grep php.ini



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-04 08:04 UTC] dingsundbums at gmx dot de
Hi *,
the max execution time is hardcoded to 0 for the cli.
You can set the max_execution_time on the commandline with 

php -d max_execution_time=5 script.php

or in the script:

set_time_limit(10); // this way
ini_set('max_execution_time', 10); // or this way

Greetings,
Dierk
 [2017-01-05 03:15 UTC] dophini at dir dot bg
why it is so on 7.0 branch? or it will be always 0 in future also?
 [2017-01-11 05:07 UTC] krakjoe@php.net
-Status: Open +Status: Not a bug
 [2017-01-11 05:07 UTC] krakjoe@php.net
As mentioned, the value is hard-coded in CLI to override the default in configuration.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 08:01:27 2024 UTC