Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8535325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:24:19+00:00 2026-06-11T10:24:19+00:00

In PHP if I set the the memory 100M via ini_set and then I

  • 0

In PHP if I set the the memory 100M via ini_set and then I set set_time_limit(0); Does that mean that my PHP memory allocation is 100M forever(Until I restart my Apache)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:24:20+00:00Added an answer on June 11, 2026 at 10:24 am

    No its reset back to the original at the end of script execution.

    From the manual:

    string ini_set ( string $varname , string $newvalue )

    Sets the value of the given configuration option. The configuration
    option will keep this new value during the script’s execution, and
    will be restored at the script’s ending.

    and set_time_limit(0); is treated the same.

    Example:

    // 1. Script starts
    echo ini_get('memory_limit');//128M
    
    // 2. We set a new limit the script will now have 100M
    ini_set('memory_limit','100M');
    echo ini_get('memory_limit'); //100M
    
    die;
    // 3. Script ends now its set back to 128M
    

    With set_time_limit(0); it just tells the script to not time out, tho say you were to use set_time_limit(0); within a loop then on each iteration its internal counter is set to 0 over and over.

    So if you were to use set_time_limit(1); within a loop as long as each iteration of the loop did not last longer then 1 second then it would still not time out as set_time_limit(n); would reset the internal timeout counter to 0 on each iteration.

    Example of it not timing out after 1 second:

    for($i=0;$i<=10;$i++){
        set_time_limit(1);
        usleep(999998); //2micro seconds from a second
        echo $i;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP script that uploads a CSV file and then saves some
I am trying upload larger files so I set this in php code ini_set('upload_max_filesize',
This is the code I'm using: <?php // Set the MySQL Configuration $db_host =
I have all php tools set up for Jenkins php projects. I set up
I have some jquery/php interaction set up on a page. It submits some data
Is there a way to set php running under apache to create folders with
<?php ini_set('display_errors',1); error_reporting(E_ALL); require_once('/include/adLDAP.php'); $adldap = new adLDAP(); $username = user123; $password = pass123;
How can I create custom variable in helper.php file set it right here and
<?php ini_set('display_errors', 0); $search = $_GET ['search']; mysql_connect(localhost, root, gokul); mysql_select_db(search123); $query = mysql_query(SELECT
I cannot upload large files. I've set php.ini as such: max_execution_time = 3600 max_input_time

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.