There is this family in Ayrshire in 1861:
John Mason 40 Chelsea Pensioner & Staff Off Militia b. Ireland
Mary E Mason 33 b. England
John W Mason 3 b. Ireland
Philip J Mason 1 b. Ayr
Alicia Ripton 72 Mother Formerly Shop Keeper b. Ireland
Address: Steels L George St, St Quivox, Ayr
Wondered whether the W middle name initial could be for William and John W Mason went by William in later years.
1851 has parents in Scarborough, Yorkshire England:
John Mason 30, Corporal 46th Regiment b. Ballimicaton (??), Ireland
Mary Elizabeth Mason 24 b. Kings Meare, Devon
In Scotland, the birth of Philip James and 3 more girls is showing
www.scotlandspeople.gov.uk1862 Ann Elizabeth, died 1862
1863 Eliza Mary
1866 Margarat Sophy, died 1875 aged 9
The family in 1871 are in Green Street Lane, Newton-On-Ayr, Ayr.
You would need to check one of the registrations for William (marriages or death) to confirm his parents' names I would suggest.
Monica