Let \(F(y){{:}{=}}\int \nolimits _t^TL(s, y(s), y'(s))\,ds\) be a positive functional defined on the space \(W^{1,p}([t,T]; {{\mathbb {R}}}^n)\) (\(p\ge 1\)) of Sobolev functions with, possibly, one or both end point conditions. It is important, especially for the applications, to be able to approximate the infimum of F with the values of F along a sequence of Lipschitz functions satisfying the same boundary condition(s). Sometimes this is not possible, i.e., the so called Lavrentiev phenomenon occurs. This is the case of the seemingly innocent Manià’s Lagrangian \(L(s,y,y')=(y^3-s)^2(y')^6\) and boundary data \(y(0)=0, y(1)=1\); nevertheless in this situation the phenomenon does not occur with just the end point condition \(y(1)=1\). The paper focuses about the different set of conditions that are needed to avoid the Lavrentiev phenomenon for problems depending on the number of end point conditions that are considered. Under minimal assumptions on the (possibly) extended value, Lagrangian, we ensure the non-occurrence of the Lavrentiev phenomenon with just one end point condition, thus extending a milestone result by Alberti and Serra Cassano to non-autonomous case. We then introduce an additional hypothesis, satisfied when the Lagrangian is bounded on bounded sets, in order to ensure the non-occurrence of the phenomenon when dealing with both end point conditions; the result gives some new light even in the autonomous case.