Hey everyone,
I have been working on developing a website using PHP and I'm now at the stage of configuring the database. I'm currently trying to decide between MySQL and PostgreSQL as the database for my project. However, before I make my choice, I want to make sure that PHP is compatible with both databases.
Can anyone shed some light on the compatibility issues that might arise when installing PHP with specific versions of databases like MySQL or PostgreSQL? Are there any specific versions of PHP, MySQL, or PostgreSQL that work well together and others that should be avoided?
I appreciate any insights or experiences you can share. Thank you in advance!

Hey there,
I have personally worked with PHP and both MySQL and PostgreSQL, so I can share my experience regarding compatibility.
I've found that PHP has good compatibility with both MySQL and PostgreSQL. However, it's crucial to ensure that you have the appropriate database extensions enabled in your PHP installation for seamless connectivity.
For MySQL, you can use the mysqli or PDO extension. These extensions have been widely used and are compatible with various versions of MySQL. I have successfully used both extensions with PHP 5.6 and newer versions, as well as different versions of MySQL, including 5.7 and 8.0.
As for PostgreSQL, the recommended extensions are PDO_PGSQL and pgsql. Personally, I've used PDO_PGSQL extensively with PHP 7.2 and PostgreSQL 10 and 11, and they worked harmoniously without any compatibility issues.
In my experience, it's essential to keep your PHP, MySQL, and PostgreSQL versions updated to ensure the best compatibility and stability. Remember to check the documentation for each version to ensure full support.
I hope this information helps you make an informed decision. If anyone has additional insights or experiences to share, I would love to hear them.
Cheers!