By Jan Lopatka and Tatiana Jancarikova

BRATISLAVA (Reuters) - French President Francois Hollande said on Friday he thought commitments by individual EU member states offered a better way of resettling African and Middle Eastern migrants rather than the imposition of national quotas by Brussels.

Debate has grown over how to deal with a growing influx of migrants into the 28-member European Union and a number of countries have stressed any acceptance system should be based on a voluntary approach.

Hollande spoke after joining a meeting of prime ministers of the Visegrad group of countries within the EU -- Slovakia, the Czech Republic, Hungary and Poland, which jointly oppose quotas.

"We need to address the reasons that have led to and that have caused the migration," Hollande told a news conference held with the central European leaders in the Slovak capital Bratislava. "I do not think (quotas) make any sense for migration. I do not think it is the right method."

The European Commission wants EU governments to agree to resettle over the next two years 40,000 asylum-seekers who reached Italy and Greece, many after perilous boat trips across the Mediterranean in which hundreds have died.

Only refugees from states deemed by the EU to be known to be facing the worst strife and conflict will be taken in.

The plan will be discussed at an EU summit on June 25-26.

Italy and Greece, bearing the brunt of the migrant wave, have repeatedly called on fellow EU states to share the burden.

QUOTAS REJECTED

Slovak Prime Minister Robert Fico, hosting a meeting of the Visegrad countries of Slovakia, the Czech Republic, Hungary and Poland, said issuing quotas among member states flew against earlier EU decisions. He said the four countries supported a voluntary approach.

"We (the Visegrad countries) are ready to talk in the European Council about how to help people who need help. But it is not possible for the Commission to propose legal regulations that lay the basis for mandatory quotas," he said.

Story continues

Czech Prime Minister Bohuslav Sobotka said he still expected a tough debate on the issue among EU leaders next week.

Countries in the EU's emerging east have faced varying pressure from the sharp increase in asylum seekers, especially countries like Hungary that border on the Balkans, a major transit route for migrants from the Middle East and Africa.

Hungary announced a plan this week to build a four-meter-(13-foot)-high fence along its border with non-EU member Serbia, a move that triggered a swift rebuke from the United Nations Refugee Agency.

Prime Minister Viktor Orban defended the move on Friday, saying Hungary needed to protect its border on the outer edge of the EU's Schengen zone in which free movement is allowed.

"When there's a complicated question, the solution should be as simple as possible. The state will protect its borders. Period," he said standing alongside the other Visegrad leaders.

"When we joined Schengen, we promised to protect our borders, which are the EU borders as well, from illegal trespassing."

Hungarian officials have said 57,000 people have crossed into Hungary illegally so far this year, up sharply from 43,000 in all of 2014. The Czech Republic and Slovakia have only seen a fraction of those numbers.

(Writing by Jason Hovet and Jan Lopatka; Editing by Mark Heinrich)