aws, amazon linux 2,

Install PHP CGI on Amazon Linux 2

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

If you want to use the PHP interpreter through CGI mode but you don’t have CGI extension installed, here I will show you how to install PHP CGI on Amazon Linux 2.

Prerequisites

  • Amazon Linux 2
  • sudo privileges
  • PHP installed

Install PHP CGI on Amazon Linux 2

Step 1. Install php-cgi.

sudo yum install php-cgi

Step 2. Restart your Web Server service.

Step 3. Verify the installation.

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

Step 4. Access 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.