Papix Posted May 2, 2024 Report Share Posted May 2, 2024 Hello community, In this guide I'm going to teach you how to install nginx + php 8.1 on freebsd. Step by Step # Install the packages pkg install -y php81 nginx pkg install -y php81-extensions php81-mysqli php81-mbstring php81-curl php81-gd # Start the services when starting the operating system sysrc nginx_enable=yes sysrc php_fpm_enable=YES # Start the services service nginx start service php-fpm start # Create the directory /var/www # Replace the server { in: @/usr/local/etc/nginx/nginx.conf server { listen 80; server_name localhost; root /var/www; index index.php index.html index.htm; location / { try_files $uri $uri/ =404; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $request_filename; include fastcgi_params; } location ~ /\.ht { deny all; } } # Restart nginx service nginx restart # Done! You can place the web files in the directory: @/var/www Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.