This seems to only occur when using Microsoft OS, MSSQL Server & IIS7.
Backup a course on a server and then restore this on a copy of the setup. The restore fails and you get a http 500 error, no log file entries or php error entries regardles of the level of debugging set.
MDL-40168 & MDL-34744 with no progress or resolution.
The work around of editing one of the core files is not acceptable as this occurs on a production server.
The backup files can come from any version from 1.9 onwards and they will fail with the issue reported above.
Moodle 2.4.3+ (Build: 20130418)
Windows NT MOODLE-WEB04 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586
PHP API 20090626
PHP Extension 20090626
Zend Extension 220090626
PHP Version 5.3.13
sqlsrv.ClientBufferMaxKBSize 10240 10240
sqlsrv.LogSeverity 0 0
sqlsrv.LogSubsystems 0 0
sqlsrv.WarningsReturnAsErrors On On