Fatal error

Hey Guys, I have one problem. When I try to insert more than 300 data using Yii form, then I get this error but less than 300 is ok. Can you tell me why I get this error and what I need to change?

Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/test/yii/framework/YiiBase.php on line 378

That’s a PHP configuration issue. Check max_execution_time. You could do this, before you import:


ini_set('max_execution_time',180);

I have changed the apache config file "max_execution_time = 300"

But still getting same problem.

Check with phpinfo() and read the PHP manual on how to change that setting. Did you forget to restart Apache?

I restart apache after change php.ini file.

some installations have two php.ini files (eg.: WAMP). One for CLI and another for web. You need to edit the proper one…

This is Linux server, I install apache,php and mysql from source. And php.ini file in /usr/local/apache2/php/

Can you tell me where is the other one?

Oh… I don’t know if there is another one in your installation… but in mine (WAMP) there are two ini files. May be not in your installation.

What says your phpinfo() runned from a browser (not from CLI) about that setting?

You can try to use set_time_limit() function.

by any chance, does your form do upload something. Coz I once got similar problem which after discovered later it is problem in my code. I use ftp_upload() but the ftp_connect() configuration was incorrect, which causing it looping till time limit exceeded…

just my $0.02

where I put this line?

In the beginning of your index.php.

Thanks. Problem solved. Thank you very much.