Guides & TutorialsPayments & Currency TroubleshootingTroubleshooting users logged out when downloading invoices

Troubleshooting users logged out when downloading invoices

Symptom

When a user attempts to download an copy of the PDF invoice via the client area, they are logged out and presented with the client area login page.

Invoice Download Button

Cause

A peculiarity in pdo_mysql clients in certain server stacks causes unexpected behaviour in PHP. This is been observed more commonly on servers running CloudLinux.

Solution

Switching to the PHP native pdo_mysql driver resolves the issue and causes PHP to behave in the expected manner.

For systems operating in CloudLinux, the change can be made as follows:

1. Access the CloudLinux PHP Configuration interface on your server

2. Deselect the pdo_mysql option

3. Select the nd_pdo_mysql option:

CloudLinux PHP Options screen showing nd_pdo_mysql

The change should be immediately applied, and the download issue in WHMCS resolved.

For other server stacks, please consult with your server admin/hosting provider to recompile PHP with the native driver.