ok I recompiled again and downgraded to 5.3.26. Now it can connect again to the database.
However, another issue has presented itself. When I updated our whmcs installation to the newest, the cronjobs no longer work. I get a segmentation fault. I contacted whmcs support and they say that there is something wrong with my php, eventhough the older version of whmcs works fine, and the other cronjobs work fine.
below is the error i get:
php -q /home/account/account.com/html/my/admin/cron.php
Segmentation fault (core dumped)