First of all it would be extremely helpful if you could provide some information about your homeland.
I'll give a general case of steps that you could do, and then a more specific case for Germany.
In general there are different possibilities to get funding for studies in EU.
- Your government provides scholarships for studies in certain countries
- The embassy/government of the country which you want to do your studies provides scholarships for foreign students
- Some 3rd party organization (European Union, European Council, NGO etc)
- The university itself has a scholarship program for foreign students
So basically what you will have to do, is visit the websites of the entities which I have listed above, and try to find the scholarships.
In the case of Germany that would be
- (This is related to your government)
- German Embassy in your country / DAAD
- Erasmus plus / Erasmus mundus / programme
- International office of your target univerisity
In general, do not hesitate to contact all the stakeholders (people etc.), that could provide you useful information; Also contact the Professor of the group that you would like to work your Phd at. They always have something in their hand.
The last and most obvious solution is getting a job. In the case of Germany as a student you are allowed to work up to 20 hours per week. If the living costs are not very expensive you can survive easily with that money. If you assume that you will be payed at least 9,5 euros per hour (this is really low), so you have the chance to go up to 13 euros per hour.
If you earn up to 450 euros per month, you don't have to pay taxes in Germany, anything more than that is subject to taxing.
Finally, in order to get the student visa in Germany you need to have 8000 eu in Bank upfront, or a documentation which confirms that you have the required funding to have at least 650 eu per month for living costs. 650 is the living cost calculated by the German government.
Have a look at this sites as well: