Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

set_time_limit don't work

Posted on 2009-05-11
5
Medium Priority
?
765 Views
Last Modified: 2012-05-06
Hi E's, I put in my code the function: set_time_limit(0), and my server gives a error after 30 seconds after start the script.
I try change the value (0) for a big number in seconds like (20000), and it's the same thing!
What I have to do in my server for time with NO LIMIT.
I have to change php.ini? where?
I have to write something in httaccess?

Regards, JC
0
Comment
Question by:Pedro Chagas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 1

Accepted Solution

by:
jimhap earned 600 total points
ID: 24359860
Safe mode may be on in your server, otherwise including set_time_limit(); should work.

If you have access to your php.ini file, find this:
max_execution_time = 30

And change it to 0 or a big number (suggestion: 0, since this means forever).

If that line doesn't exist, add that and change it to the proper number.
0
 
LVL 7

Expert Comment

by:ycTIN
ID: 24360499

This function has no effect when PHP is running in safe mode. There is no  workaround other than turning off safe mode or changing the time limit in the  php.ini.
0
 
LVL 3

Assisted Solution

by:markh789
markh789 earned 400 total points
ID: 24362884
If your safe mode is on functions are disabled, see the full list here: http://php.net/manual/en/features.safe-mode.functions.php

It reads:
set_time_limit() - Has no effect when PHP is running in safe mode.

Read this: http://au.php.net/set_time_limit
From php.net:
Warning
This function has no effect when PHP is running in safe mode. There is no workaround other than turning off safe mode or changing the time limit in the php.ini.

You can try setting in PHP.INI find max_execution_time, set it to 0 for inifity or set it to your own number.
0
 
LVL 3

Author Comment

by:Pedro Chagas
ID: 24363492
hi e's, if i tell to administrator of my server to change for 'no safe mode', what is the diferences between safe mode or no safe mode.
regards, jc
0
 
LVL 3

Assisted Solution

by:markh789
markh789 earned 400 total points
ID: 24392808
Safe mode disables functions basically, as an attempt to try and secure the server from attacks through PHP code.

See this website to see what safe mode can do:
http://www.php.net/manual/en/features.safe-mode.php
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question