The major components of panels that are mined and processed are quartz, copper and aluminium. Various attempts to calculate how much greenhouse gas is produced in the mining of these materials and the manufacture of panels suggest that this is recovered by production of carbon-free electricity in about two years. This is regarded as a good return on investment, particularly as panels are expected to be used for well over 25 years. So from a global warming perspective they have a positive environmental impact. 

However, there can be negative social and environmental impacts from the mining process, which depend upon where the minerals are sourced and how well the mines are managed. Panels made from ethically sourced materials do exist, so it is worth asking your supplier about this (even if just to get them thinking about it). Ethical Consumer rank different panel manufacturers, but you do need to subscribe to them to access the rationale behind their scoring. Recycling at the end of their lifetime is yet to be fully solved, but once well-established, this should reduce the need for new raw materials.