use php instead of shell commands, to be more system independent