They problem may be that you need a renderbuffer.

framebuffer = glGenFramebuffersEXT(1)
renderbuffer = glGenRenderbuffersEXT(1)

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT,framebuffer)
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT,renderbuffer)
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,GL_DEPTH_COMPONENT,  size[0],size[1])

glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,GL_DEPTH_ATTACHMENT_EXT,GL_RENDERBUFFER_EXT,renderbuffer)

glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,attachment,GL_TEXTURE_2D,texture,0)

glBindRenderbufferEXT(GL_RENDERBUFFER_EXT,0)
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT,0)