What are some common issues when adding extensions to PHP, and how can they be resolved?

Issue: One common issue when adding extensions to PHP is that the extension may not be properly installed or enabled in the php.ini configuration file. This can result in PHP not recognizing the extension and causing errors when trying to use its functions. Solution: To resolve this issue, you can check if the extension is installed and enabled in the php.ini file. You can do this by using the phpinfo() function to see the current PHP configuration and look for the extension in the list of loaded extensions. If the extension is not listed, you will need to enable it by adding the extension directive in the php.ini file and restarting the web server.

<?php
// Check if the extension is loaded
phpinfo();
?>