PHP must have write permissions to the directory where you're trying to create the file. The error message is stating that it doesn't.
Therefore, it's unlikely that your FTP's CHMOD command succeeded. Are you sure the directory has 777 (or "drwxrwxrwx" if the FTP client displays permissions in that manner) permissions? Based on the PHP error message, I would have to guess that it does not.
EDIT: Also note that PHP has to have at least execute permissions on all directories above the one you're trying to write to. Then again, if you truly are trying to create a file in the same directory that the script is being executed in, it's a safe bet to assume this is already true.