php had to be running in safe mode to be able to override mysql options with the ones in php.ini file. That is not a good solution for this problem trough.