I don't think you can create folders in the root directory with PHP as it does not have the permission to do that.
However, what you probably could do, is to create a folder in the root directory through an ssh terminal and use that folder for your application
sudo mkdir /myApp
Next, set write permissions to myApp folder
sudo chmod -R 777 myApp
subsequently, you would be able to create your "uploads" folder in /myApp
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…