How can I run a PHP script by dropping file on icon?
Yes, this should be possible using Automator. I haven't worked with php from the command line, so I'm unsure exactly how that works, but this is a general instruction.


Open Automator (It's in the Applications folder).
Choose to create an Application.

Select Utilities under Library and choose Run Shell Script and drag it to the area on the right.

In the text area for the run shell script action, remove 'cat' and write the full path to the script you wish to run.
Select to Pass input to stdin.
Save the Application somewhere and drag it to your dock.
Try it out by dragging a file to it.