You could use the ogr2ogr commandline tool to accomplish this. You don't need php. Using a vrt file, you would be able to define the geometry and other columns you want.
Everything you need to know is explained in details here: http://www.gdal.org/ogr/drv_csv.html
ogr2ogr is a tool included in GDAL/OGR library.