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.