Let's take the second circuit first. What you are seeing is a pathological condition. Letting the +in float is asking for trouble, and you're getting it. Just as an exercise, try triggering the scope on the middle of the rising edge of your waveform. When you do this, you'll probably see the measured frequency change to 120 Hz. Whenever you see 120 Hz on a circuit which should be giving you DC, you know you're picking up AC hum, and I suggest that's what's happening. The floating input is varying at 120 Hz, which is 60 Hz rectified by internal diode junctions, and the output reflects that. Never, ever, ever let input pins float on an op amp. For that matter, I suggest you configure the 3 unused channels as followers and tie them to something convenient like 2.5 volts, which you make by using two resistors in series for +5 to ground.
Now, the first circuit. You're probably not aware of this, but LEDs are pretty bad photodiodes, and putting them in a colored body makes their response to "white" light even worse.
EDIT - Part of the reason that LEDs aren't great photodiodes is that their collecting area is very small. Dedicated photodiodes which are that small are usually intended to be used with high light levels, and can operate at higher frequencies. END EDIT
Also, running your op amps single-supply means that you can't measure what happens when a signal tries to go negative. I suspect that you've got issues with the offset voltage of your op amp, and your test illumination is insufficient to overcome it.
My first bit of advice is to get a second power supply, and drive your op amp with +/- 5 volts. If you're not willing to do that, try offsetting the input with a virtual ground.
simulate this circuit – Schematic created using CircuitLab
A word of warning - You must use an isolated 5V supply. If you don't, when you connect your scope clip to the virtual ground, you may well get sparks, melted wire insulation, and dead components. Some cheap power supplies from places like China do not have isolated grounds. Caveat emptor applies.
If you're stuck on this, you can get around it by using an AC light source. Illuminate the LED with another LED tied face-to-face with a few turns of electrical or masking tape (not scotch or magic tape, since they are transparent.) Drive the new LED with a circuit like this
simulate this circuit
This will give a square wave at about 30 Hz, and you can use your scope's AC coupling to get rid of the 2.5 v offset on the photodiode output.