The permimission flag 777 is not the problem here but the user/group assigned to the folder in question.
Looks like you are using suEXEC feature. Whey using suExec, litespeed does not allow execution of scripts as users with priviledges lower (more powerful) than the min uid and min gid in server security settings.
This is done for security reasons. Set both of those to 0 and try again.