The phpgpio extension provides an API to control your GPIO's (with the Wiring Pi library)