aws, amazon linux 2,

Install PHP PDO on Amazon Linux 2

Jan 28, 2023 · 1 min read · Post a comment

If your app is PHP based and you need to establish a database connection, you will need to have a PHP PDO extension. Let’s install the PHP PDO extension on Amazon Linux 2.

Prerequisites

  • Amazon Linux 2
  • sudo privileges
  • PHP installed

Install PHP PDO on Amazon Linux 2

Step 1. Install php-pdo.

sudo yum install php-pdo

Step 2. Restart your nginx or apache service depending on your web server.

Step 3. Verify the installation.

echo "<?php phpinfo(); ?>" > /var/www/html/info.php

Step 4. Check the file (info.php) in the browser.

http://server_ip/info.php

Conclusion

Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.