Home > Database > Mysql Tutorial > body text

Why Are My `ini_set` and `set_time_limit` Calls Being Ignored in PHP?

Barbara Streisand
Release: 2024-10-30 02:51:02
Original
729 people have browsed it

Why Are My `ini_set` and `set_time_limit` Calls Being Ignored in PHP?

PHP Runtime Configuration Issue: ini_set and set_time_limit Ignored

Problem:

When attempting to set max_execution_time using ini_set() or set_time_limit(), the changes are ignored on certain servers, resulting in the default value of 30.

Answer:

In safe mode, PHP restricts the ability to modify certain configuration settings, including max_execution_time. As per the PHP manual, "You can not change this setting with ini_set() when running in safe mode." The same restriction applies to set_time_limit().

Solution:

There are two possible solutions:

  • Disable Safe Mode: Disable safe mode either in the server configuration or in the php.ini file.
  • Modify php.ini: Manually edit the php.ini file and set max_execution_time to the desired value. This must be done on the server where the code is running.

The above is the detailed content of Why Are My `ini_set` and `set_time_limit` Calls Being Ignored in PHP?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template