I see no reason why this should be happening, unfortunately. Are you sure you aren’t getting an error in your code which is causing it to not complete?
Here is an MWE which shows that the for loop does indeed work
julia> F(x) = x;
julia> x0 = 0;
julia> x1 = 1;
julia> n = 10;
julia> Phi = zeros(n+1);
julia> for k = 0:n
println(k)
Phi[k+1] = F(x0 + cos(pi*(k-1)/n)+1.0)*(x1-x0)/2
end
0
1
2
3
4
5
6
7
8
9
10