zing hay
zing hay

Reputation: 11

Php set_time_limit not available, is there any other way around?

I have a site that I must develop and my client has a shared hosting. And as such, php is running in safe mode, thus I can not use set_time_limit. I have a lot of xml files that I have to upload into mysql, which will take much more than 30s. Is there anything I can do on this environment?

Thank you.

Upvotes: 1

Views: 311

Answers (2)

Moein Hosseini
Moein Hosseini

Reputation: 4383

I don't know is there a way to set it or not with out set_time_limit function,but I suggest you to do it by ajax,you can do it by call your page again and again with different argument in one ajax file,argument set which xml file should be insert into mysql database.

Upvotes: 0

Marc B
Marc B

Reputation: 360602

PHP's time limits only applies to the actual script itself. You can fire up a sub-script using exec() or similar and do the importing in there. That sub-script can take as long as it wants, as the time spent while executing that script doesn't count against the parent's limit.

Upvotes: 2

Related Questions