Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Maximum execution time #6

Closed
tho-can-code opened this issue Dec 13, 2012 · 6 comments
Closed

Fatal error: Maximum execution time #6

tho-can-code opened this issue Dec 13, 2012 · 6 comments

Comments

@tho-can-code
Copy link

When I have a large data in CSV file (in my case, I have the data with 24 columns and 1000 rows need to be imported), it's will have the error

Fatal error: Maximum execution time of 30 seconds exceeded...

Would you like to check to avoid this issue?

@suin
Copy link
Member

suin commented Dec 13, 2012

You may have to increase your PHP maximum execution time setting.

See:

@tho-can-code
Copy link
Author

The problem is if I'm using a server and I don't have permission to modify PHP maximum execution time setting, how can I increase it. And how can we determine what time is enough if we have a very big data to import ???

@suin
Copy link
Member

suin commented Dec 13, 2012

Did you try set_time_limit() above?

@tho-can-code
Copy link
Author

I have tried to call set_time_limit(0)

if ($count === 0) {
$stmt = $pdo->prepare('INSERT INTO user (id, name, email) VALUES (?, ?, ?)');
$stmt->execute($columns);
set_time_limit(0);
}
...

but it can't work well.

@suin
Copy link
Member

suin commented Dec 13, 2012

Humm... You should contact your server admin.
It seems that you have no permission to change that limitation.
If safe-mode is enabled by php.ini, you have no way to increase that.

http://php.net/manual/en/ini.sect.safe-mode.php#ini.safe-mode

@tho-can-code
Copy link
Author

Hummm... I'll contact my server admin to find a solution for this.
Another one, I have tried to debug, it seems that we always have an exception error at the end.
Can you check?

try {
echo "importing.........";
$lexer -> parse($path, $interpreter);
} catch (\Exception $e) {
echo "error.........";
$result['error'] = 'error message';
}

alexander-schranz added a commit to alexander-schranz/csv that referenced this issue Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants