To install the Apache, MySQL, PHP (AMP) stack on a FreeBSD Unix server, follow these steps:
sudo pkg update
sudo pkg install apache24
sudo sysrc apache24_enable=yes
sudo service apache24 start
sudo pkg install mysql80-server
sudo sysrc mysql_enable=yes
sudo service mysql-server start
sudo pkg install mod_php74
sudo sed -i '' 's|#LoadModule php7_module|LoadModule php7_module|' /usr/local/etc/apache24/httpd.conf
sudo service apache24 restart
You can verify the installation by creating a file called info.php
in the Apache document root (usually /usr/local/www/apache24/data
) with the following content:
<?php phpinfo();
Then, access the file through a web browser (e.g., http://your-server-name/info.php
). This should display the PHP information page.
The AMP stack is a common combination of software used to run dynamic websites and applications. Apache HTTP Server is a web server, MySQL is a database management system, and PHP is a programming language.