Hi,
I have a query ... I have changed php max_execution_time in php.ini to say 600 seconds. It worked on Windows platform. However the same code doesn't work in Linux redhat5. I even tried ini_set('max_execution_time', 600); in a php file but it still executes its default time that is 10 seconds. Moreover i tried to change in /etc/httpd/conf/httpd.conf by introducing following lines of codes -

**<IfModule mod_php5.c>
php_value max_execution_time 600
</IfModule>**

But still no effects it still runs for 10 seconds ... Please help !!

Recommended Answers

All 10 Replies

Hi,

to verify if your setting is applied you can use:

echo ini_get('max_execution_time');

Questions:

  • The timeout error is at PHP or database level?
  • Can you paste the error message and error code here?
  • And, if pertinent, which database and version of it, are you using?

@Cereal .. Thanks but I already tried that. The resultant was 600 then 300. "300" because i wrote a line on the page -

ini_set('max_execution_time', 300);
echo ini_get('max_execution_time');

But all in vain as the script runs only for about 10 seconds :(

however there is one issue though ... I don't see any errors or Warnings. Should I be concerned ?

What I am trying to do is creating image (thumbnails) for HD Resolution Photos which works fine as images are created using PHP-GD and after images are created they should be in a specified folder and so i moved them <---- This too works

And then there resultant paths are kept in a MySQL(MYISAM Engine) DB ....

Above here i faced a problem if I select 100+ HD Photos it takes only 20 of them and puts them in the Folder and keeps only those 20 Records .... This was due to "max_execution_time" <----- I think but I am not sure, as the script runs for about 10 seconds max !!!! Please Help.....

by 20 i mean first 20 Photos ...

I am using PHP 5.1 in Linux and Default Apache that comes with RHEL5 (i guess its quite old)

I don't see any errors or Warnings. Should I be concerned ?

If the value is set then the script may exit for another reason, it could be memory exhausted or something else, check the error log file of PHP or set:

error_reporting(-1);

To get all errors, notices and warnings.

Above here i faced a problem if I select 100+ HD Photos it takes only 20 of them and puts them in the Folder and keeps only those 20 Records .... This was due to "max_execution_time" <----- I think but I am not sure, as the script runs for about 10 seconds max !!!!

If you prepended any function with the error control operator @, for example @file('...') you will not see that specific error, so temporary remove them to debug the script.

If you still don't get any errors then, if possible, share your code, this will help us to understand the issue.

I am using PHP 5.1

If possible upgrade PHP to latest version, PHP 5.1 last update was in 2006. Not good.

Member Avatar for diafol

Using CLI or a cron job should circumvent the execution timeout, if that's possible for you.
A quick fix may be to use Ajax to call each thumb creation one at a time - that way you could use a progress bar too, e.g. count of a 100.

@Cereal .. Thanks I'll try :) ok if it doesn't work i'll share my code here !!

Well, the machine and the server i am working on has no internet connection :( so upgrade is almost impossible still i am planning to install PHP 5.6.10 and Apache 2.4

Let's hope RHEL5 supports !!!

@diafol .. ok yours next first let me try @cereal's idea.

By the way which framework is easy to learn and not so bulky LARAVEL, MVC or Yii ?

Guys I also need Daniweb Help Tips ... I am not able to delete my own posts !! If you know any tricks in daniweb please share :)

Member Avatar for diafol

I've used Yii and Laravel - both are really nice to use. Laravel may take a bit more effort to get off the ground, but it's the only framework I use these days. But I still have a soft spot for Yii - it's so cute. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.