Section 57. If it appears on oath that a salaried officer of the commonwealth has attended court as a witness in behalf of the commonwealth, at a place other than his residence, and that his necessary expenses have been increased by such attendance, the court may allow such increased necessary expenses, not exceeding one dollar and fifty cents a day in all, for such actual and necessary attendance.