How To Install Nginx, MySQL and PHP (FEMP) Stack on FreeBSD 13.0
1. First, update your FreeBSD system. # freebsd-update fetch # freebsd-update install 2. Install Nginx. # pkg install nginx Enable Nginx: # sysrc nginx_enable=yes Start Nginx: # service nginx start Check if nginx is running normally? It worked. 3. Install MySQL # pkg install mysql80-client mysql80-server Enable MySQL: # sysrc mysql_enable=yes Start MySQL: # service mysql-server start Starting mysql. 4. Install PHP The following command to install php8.0 and commonly used modules: # pkg install php74 php74-mysqli php74-mbstring php74-zlib php74-curl php74-gd php74-json 5. Configure Nginx and PHP to make them work together Edit Nginx's config file /usr/local/etc/nginx/nginx.conf uncomment or modify or add config as follows: user www; error_log /var/log/nginx/error.log; http block: access_log /var/log/nginx/access.log; location ~ \.php$ { root ...