OCC has Database problem: "Failed to connect to the database"

After I was able to get the content of the php.ini file from my webspace I was able to get occ working from ssh.

I created a ~/.bashrc file containing:
occ() { {PathToPhp} -c {PathTo/Php.ini} {PathTo/occ} $@ }

because .bashrc do not get loaded automatically I start it my self after logging into ssh:
source .bashrc

now I could start occ commands:
occ files:scan --all