Cappuccino 43 Posted February 7, 2021 Share Posted February 7, 2021 There instructions have been tested on FreeBSD 12.1! First of all we want to install update the package repository: pkg update If you have never used pkg probably you will be asked to install it. Now run this command to install php7.4 and nginx pkg install php74 nginx We can install the most common php extensions running this command: pkg install php74-extensions php74-mysqli php74-mbstring php74-curl php74-gd The following extensions will be installed: php74-ctype: 7.4.14 php74-curl: 7.4.14 php74-dom: 7.4.14 php74-extensions: 1.0 php74-filter: 7.4.14 php74-gd: 7.4.14 php74-iconv: 7.4.14 php74-json: 7.4.14 php74-mbstring: 7.4.14 php74-mysqli: 7.4.14 php74-opcache: 7.4.14 php74-pdo: 7.4.14 php74-pdo_sqlite: 7.4.14 php74-phar: 7.4.14 php74-posix: 7.4.14 php74-session: 7.4.14 php74-simplexml: 7.4.14 php74-sqlite3: 7.4.14 php74-tokenizer: 7.4.14 php74-xml: 7.4.14 php74-xmlreader: 7.4.14 php74-xmlwriter: 7.4.14 Enable nginx and php service to automatically start sysrc nginx_enable=yes sysrc php_fpm_enable=YES We can start nginx and php for the first time by running service nginx start service php-fpm start You can open now your web browser and type the server ip in the address bar. You should see a page like this We are going to configure nginx now. Open the file nginx.conf located in /usr/local/etc/nginx and modify the section "server": server { listen 80; server_name _; 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; } } Change mydomainname.com with your domain (or server ip). We can test now if php is working correctly. The files of your webiste will be hosted in the folder /var/www (you can change it in the configuration above). Create a new file inside that folder and call it index.php with this content: <?php phpinfo(); Now open again the browser and type the ip address/domain name and you should see something like this: The server is working properly and you can upload now your script You might need to install more php extentions according to the requirements of your script 2 2 3 Link to comment Share on other sites More sharing options...
Bizzy 101 Posted February 23, 2021 Share Posted February 23, 2021 (edited) dont work Starting php_fpm. /usr/local/sbin/php-fpm: Undefined symbol "setproctitle_fast@FBSD_1.5" [23-Feb-2021 12:13:11] ERROR: no data have been read from pipe /usr/local/etc/rc.d/php-fpm: WARNING: failed to start php_fpm Edited February 23, 2021 by Bizzy Link to comment Share on other sites More sharing options...
Cappuccino 43 Posted February 23, 2021 Author Share Posted February 23, 2021 Which freebsd version are you using? Have you installed php from pkg? Link to comment Share on other sites More sharing options...
Bizzy 101 Posted February 23, 2021 Share Posted February 23, 2021 is fixed i switch to freebsd 12.1 and is okay sry can you make a tutorial for ishop or so? ^^ Link to comment Share on other sites More sharing options...
Cappuccino 43 Posted February 28, 2021 Author Share Posted February 28, 2021 On 2/23/2021 at 8:55 PM, Bizzy said: is fixed i switch to freebsd 12.1 and is okay sry can you make a tutorial for ishop or so? ^^ You have to purchase an item shop script or get one for free in the internet and host it on your server. You have just to throw the ishop folder inside /var/www Link to comment Share on other sites More sharing options...
Luffy 9 Posted November 6, 2023 Share Posted November 6, 2023 Does it work for freebsd 13.2? “To be humble with superiors is duty, with equals is courtesy, with inferiors is nobility.” Benjamin Franklin Por favor, desative seu AdBlock quando usar meus links de download. Please, disable your AdBlock when use my download links. Me AdBlock On: Adblock Off: Link to comment Share on other sites More sharing options...
Cappuccino 43 Posted December 8, 2023 Author Share Posted December 8, 2023 sure but I recommend installing php 8.2 now Link to comment Share on other sites More sharing options...
Recommended Posts