Skip to navigation
How to install PHP with nginx on FreeBSD 14
30.07.24
# Install nginx and PHP and enable php ```console pkg install nginx sysrc nginx_enable="YES" service nginx start pkg install php83 cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini sysrc php_fpm_enable="YES" ``` # Setup php-fpm ## edit /usr/local/etc/php-fpm.d/www.conf ``` listen = /var/run/php83-fpm.sock listen.owner = www listen.group = www listen.mode = 0660 ``` ## test PHP ```console sysrc -a | grep php service php-fpm start service php-fpm status sockstat -l | grep php ``` # Edit nginx ## add to /usr/local/etc/nginx/nginx.conf ```ini location ~ \.php$ { root /usr/local/www/nginx; fastcgi_pass unix:/var/run/php83-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } ``` ## Test nginx ```console # checking Nginx syntax nginx -t # restart Nginx service service nginx restart ```
https://geekandnix.com/freebsd/install-php/
Reply
Anonymous
Information Epoch 1730248197
Don't do anything the computer can do for you.
Home
Notebook
Contact us