简体   繁体   English

如何在运行时覆盖max_execution_time的php.ini值?

[英]How can I override the php.ini value of max_execution_time at runtime?

I don't have acess to php.ini in my server. 我的服务器中没有访问php.ini I want to change the maximum execution time so that my script can runs for more than 30 seconds. 我想更改最长执行时间,以便我的脚本可以运行超过30秒。

is there any way i can do that on the start of my script? 我有什么方法可以在我的剧本开头做到这一点?

use ini_set 使用ini_set

ini_set('max_execution_time', 300);  // this will set max_execution time for 300 seconds

write this line at start of your code in php file. 在php文件中的代码开头写这行。

OR 要么

use this by Hanky Panky ㇱ 用这个来自HankyPankyㇱ

set_time_limit(300);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在php.ini中更改upload_max_filesize和max_execution_time? - How do I change upload_max_filesize and max_execution_time in php.ini? 在FTP中使用php.ini更改max_execution_time - change max_execution_time with php.ini in FTP phpMyAdmin 超时不考虑 PHP.ini max_execution_time - phpMyAdmin timeout not respecting PHP.ini max_execution_time php.ini中max_execution_time的最大允许值是多少 - What is the maximum allowed value of max_execution_time in php.ini 如何在不更改 php.ini max_execution_time 的情况下避免超过 Laravel 的最大执行时间 60 秒 - How to avoid Maximum execution time of 60 seconds exceeded Laravel without change php.ini max_execution_time 更改了php.ini中的max_execution_time设置,Drupal仍然存在问题 - Changed setting in php.ini for max_execution_time, Drupal still having problems php.ini 中的 max_execution_time 不会更新,其他设置会 - max_execution_time in php.ini wont update, other settings will 最长执行时间php.ini - Max execution time php.ini 我的共享服务器的全局php.ini将cronjob限制为max_execution_time为30秒,无法导入大文件 - Global php.ini of my shared server limits cronjob to max_execution_time to 30 seconds cannot import large file 我可以将php.ini中的最大执行时间设置为30,000吗? - Can I set max execution time in php.ini to be 30,000 in my case?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM