05-20-2021, 10:02 AM
(05-20-2021, 05:10 AM)Mashiro Wrote: In that case you can skip the addition of the 3rd party repository for PHP 8.0.This is brilliant many thanks @Mashiro. I didn't know that php 7.3 came with Debian. Thank you for the detailed suggestions of how to make a change to 7.3 from 8.0 in the tutorial. I won't try it immediately, but am filing it away for a future install.
At the step where we install PHP 8.0 in this guide you would install PHP 7.3 (ships with Debian 10 by default). Just replace "php8.0" in the packages with "php7.3". You might want to see with all packages are available that you need. In some cases they might have different names.
You can find all available PHP 7.3 packages via apt-get cache search function:
Code: (Select All)apt-get update
apt-get cache search php7.3
It will most likely output a big list with everything that contains the string "php7.3". You of course want to look for packages just starting with php7.3 and packages with php7.3- (that would be the PHP extensions like php7.3-fpm for example or php7.3-xml).
Here is a small rundown from the Debian "Buster" 10 PHP package database:
(from https://packages.debian.org/buster/php/)Code: (Select All)php7.3
php7.3-bcmath
php7.3-bz2
php7.3-cgi
php7.3-cli
php7.3-common
php7.3-curl
php7.3-dba
php7.3-dev
php7.3-enchant
php7.3-fpm
php7.3-gd
php7.3-gmp
php7.3-imap
php7.3-interbase
php7.3-intl
php7.3-json
php7.3-ldap
php7.3-mbstring
php7.3-mysql
php7.3-odbc
php7.3-opcache
php7.3-pgsql
php7.3-phpdbg
php7.3-pspell
php7.3-readline
php7.3-recode
php7.3-snmp
php7.3-soap
php7.3-sqlite3
php7.3-sybase
php7.3-tidy
php7.3-xml
php7.3-xmlrpc
php7.3-xsl
php7.3-zip
At parts of the tutorial where we fixed something in PHP or PHP-FPM the path to the files would be /etc/php/7.3/xxx (xxx standing for the subfolders like fpm).
So you would need to adjust commands where the path is /etc/php/8.0:
This
ToCode: (Select All)sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/php/8.0/fpm/php.ini
Code: (Select All)sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/php/7.3/fpm/php.ini
I guess you get what I mean.
And the vHost for the main site would need a small change, too.
Replace:
Code: (Select All)fastcgi_pass unix:/run/php/php8.0-fpm.sock;
With:
Code: (Select All)fastcgi_pass unix:/run/php/php7.3-fpm.sock;
I think so at least. To verify that it is really so you have to look at /etc/php/7.3/fpm/pool.d/www.conf and see what it says at the listen socket path and file name. I think it is /run/php/php7.3-fpm.sock.
That's about it. The basic rundown. You leave PHP 8.0 away and install PHP 7.3. You fix things that we fixed in PHP 8.0 in PHP 7.3. And you change a bit of code for PHP processing in the Nginx vHost file.
I'm totally driven at the moment. So while I was trying to sleep (unsuccessfully), I wondered what it would be like to add another blog. First I went to freenom to create a new domain. That took some patience but by fourth try I managed to get one. The DNS from Freenom worked instantly.
Next I followed your steps again, from the point where you create a dot.conf file for the domain. It went effortless. Including MariaDB and next thing I've got a second blog up and running. So I really do not need a panel now! Also once one has set up the servers, second blogs or websites are very fast to create. The more one does it too, the easier it gets.
In summary the steps I followed for the second blog from your tutorial are:
1. Create an empty vHost file for the new site:
Code: (Select All)
nano /etc/nginx/conf.d/newsite.tk.conf
2. Paste the following code in the file:
Code: (Select All)
server {
listen 80;
server_name newsite.tk www.newsite.tk;
root /var/www/newsite.tk;
index index.html index.htm index.php home.html home.htm home.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php/php8.0-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
}
Ctrl X
3. Create a new folder tree:
Code: (Select All)
mkdir -p /var/www/newsite.tk
4. Set correct ownership of folder:
Code: (Select All)
chown -R nginx:nginx /var/www
5. Restart Nginx:
Code: (Select All)
systemctl restart nginx
6. Create a new Database in MariaDB
Code: (Select All)
mysql -u root -p
Password: password
Code: (Select All)
CREATE DATABASE newsite;
Code: (Select All)
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
Code: (Select All)
GRANT ALL ON newsite.* TO 'newuser'@'localhost';
Code: (Select All)
FLUSH PRIVILEGES;
Code: (Select All)
quit
7. Restart mariadb and nginx
Code: (Select All)
systemctl restart mariadb
Code: (Select All)
systemctl restart nginx
8. Create WordPress Installation
Code: (Select All)
cd /var/www/newsite.tk
Code: (Select All)
wget https://wordpress.org/latest.tar.gz
Code: (Select All)
tar -xvf latest.tar.gz
Code: (Select All)
mv /var/www/newsite.tk/wordpress/* /var/www/newsite.tk
Code: (Select All)
rm -rf /var/www/newsite.tk/wordpress
Code: (Select All)
rm -rf /var/www/newsite.tk/latest.tar.gz
Code: (Select All)
chown -R nginx:nginx /var/www/
9. Restart Nginx
Code: (Select All)
systemctl restart nginx
10. Get URL up and follow WordPress Installation Prompts