Euler-Bernoulli beam theory states that in static conditions the deflection $w(x)$ of a beam relative to its axis $x$ satisfies
$$EI\frac{\partial^4}{\partial x^4}w(x)=q(x)\ \ \ \ (1)$$
where $E$ is Young's modulus, $I$ is the second moment of area and $q(x)$ is an external loading. This equation can be rather easily derived. The standard interpretation is that $EIw''(x)$ is the internal bending moment that an element of the rod exerts on its neighbour.
The standard analysis of Euler buckling is that if in addition one has an axial compression of force $F$, it also exerts an internal moment, equal to $Fw$. Torque balance then means
$$EI w''(x)+Fw=0\ ,\ \ \ \ (2)$$
the solution of which is clearly $$w=A \sin\left(\sqrt{\frac{EI}{F}x}+\phi\right)\ .$$ and from this one immediately obtains Euler buckling criterion $F_c=\pi^2\frac{EI}{L^2}$.
All this is standard textbook stuff. BUT, if there is no axial force, then Eq. (2) reads
$$EIw''(x)=0$$
which is much stronger with (1). That is, a general solution to (1) (the ones given in wikipedia, for example) does not satisfy (2). How can one resolve this?