aws, amazon linux 2,

How to Install PHP Devel on Amazon Linux 2

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

Building PHP extensions can be done through the php-devel package which contains files needed for PHP extensions. Today’s aim is to install PHP Devel on Amazon Linux 2.

Prerequisites

  • Amazon Linux 2
  • sudo privileges
  • PHP installed

Install PHP Devel on Amazon Linux 2

Step 1. Enable the desired PHP version.

sudo amazon-linux-extras enable php{version}

Step 2. Install php-devel.

sudo yum install php-devel

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

Step 4. Verify the installation.

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

Step 5. 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.