# PHP PDO MySQL connection fails, API endpoints return 500

**URL:** <https://forum.infinityfree.com/t/php-pdo-mysql-connection-fails-api-endpoints-return-500/121983>\
**Category:** Hosting Support\
**Created:** [November 15, 2026, 7:12pm UTC](https://forum.infinityfree.com/t/php-pdo-mysql-connection-fails-api-endpoints-return-500/121983 "2026-11-15T19:12:34Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [November 16, 2026, 1:39pm UTC](https://forum.infinityfree.com/t/php-pdo-mysql-connection-fails-api-endpoints-return-500/121983/5 "2026-11-16T13:39:47Z")

</div>

A 500 error just means your PHP code has crashed, but it doesn’t tell why. It could be an unhandled error in the database connection, or it could be something else entirely which has nothing to do with the database connection at all.

So the first step is to figure out what the actual PHP error is.

We have an article about HTTP ERROR 500 errors here:

> [@HTTP ERROR 500: fixing PHP errors on your website](https://forum.infinityfree.com/t/http-error-500-fixing-php-errors-on-your-website/49352):
>
> When you open your website, your browser may show a page saying “This page isn’t working” and “is currently unable to handle this request” with the error code HTTP ERROR 500. Some browsers show a blank page instead. This means the PHP code of your website has crashed. The browser’s error page doesn’t tell you why, so the first step is to get the actual error message. Seeing a “Something Went Wrong!” page instead? That page is shown when your .htaccess file contains an error, not your PHP code…

In short: you can enable Display Errors on your website through our panel, which lets you view the error on your website, which works for most sites. We don’t have any kind of error log file that you or we can use to check the error.

---

_[View the full topic](https://forum.infinityfree.com/t/php-pdo-mysql-connection-fails-api-endpoints-return-500/121983)._
