Disable PHP, and don't enable it again until you havae cleaned up all, and set correct directory and file permissions so that 'www' cannot modify code files.
Distrust anything which is writable by 'www'.
Never use 777 permissions.
Check for latest versions of all your applications.