PhD in Europe without scholarship from non-European homeland
I only know the situation in Germany:

In order to get a visa, you are required to show that you can fund your PhD study. Either by scholarship, salary, or your personal means.

Usually, at least in CS, PhD students are employees of the university. You don't sign a contract that you are going to do a PhD, instead, you sign a contract that you will work for the university, "and you will be supported for doing a PhD". Your salary will be more than enough to support yourself (and thus for visa regulations).

However, it is also possible to do an external PhD. In this case you will not be an employee, rather a PhD student. What you need would be to find a professor who is willing to advise your work. In this case, you might get some scholarship from institutions like DAAD.