v.01

!Friendica Support
#friendica Q&A @Tutorial

How does the setting:
'php_path' =>, definable in the /config/local.config.php or by the console via /bin/console config work exactly?

The setting 'php_path' => '/usr/bin/php', that actually also shows up in the crontab -e file doesn't exist as an existing folder structure and/or file, at least on this standard ubuntu server installation, but was the original setting of this instance when we ported it from a friendica beta hosting service over here to a single IP VPS server with a single domain. And till now with that setting this instance ran quite well.

Where does /usr/bin/php actually point to, by whom is ist accessed (www-data?) and is there a way to change the reference it points to (if it is actually a reference inside friendica)?

On this server, in the case of the installed friendica versions 2024.xx we set this to:
'php_path' => '/etc/php/8.1/fpm/' and for now the display in the admin panel looks quite right:
PHP version 8.1.31 php.ini /**/8.1/fpm/php.ini

reasons for this "help to understand" request
This server is being setup to host different sub/domains, including different and older friendica instances (3.4.3/2019.12/2021.01/2021.04). The idea is at least to be able eventually to evolve them step by step to the actual stable or old stable versions of friendica. To achieve that this tutorial was used to be able to manage different php versions on the same VPS. The references for the php versions were taken from this github page.
There for the way the php version used for the different friendica versions is crucial to make things work in the first place.
in reply to TupambAdminOrg [2024.03]

Where does /usr/bin/php actually point to, by whom is ist accessed (www-data?) and is there a way to change the reference it points to


This is entirely up to your operation system configuration. You can usually install multiple versions of (in this case PHP) alongside on the server that are called on /usr/bin/phpX.YZ (assuming /usr/bin being the place on your OS for executeables), but "the main" version should also be available at /usr/bin/php so that stuff that does not care for the exact version finds something.

The path /etc/php/8.1/fpm looks like pointing to the configuration files of PHP-FPM 8.1 but not to an executeable. That it looks quite right might be, that the default version that PHP links to at your system is currently version 8.1.

On Debian this is managed by the Alternatives systems.

in reply to Tobias

Thx for that hinting clarifying answer @Tobias.

I just started to search again for the /usr/bin/ directory and it pooped up, it didn't before because I was searching for /usr/bin/php. In general as of now I didn't get how this ubuntu server really works as a ls -l search from the root directory only gives a snap directory as an entry and searching into that is kinda dead end.

Listing /usr/bin/ I got the following directories displayed:
(/php itself is a reference thats why it didn't show up)

php -> /etc/alternatives/php
php.default -> php8.3
php5.6
php7.2
php8.1
php8.3
php8.4
phpdbg -> /etc/alternatives/phpdbg
phpdbg8.4

So I tried to go to /etc/alternatives/php, but again php is a reference so /etc/alternatives/ is the actually directory to go to. Listing that one gives the following list of php directories.

php -> /usr/bin/php.default
php-fpm.sock -> /run/php/php8.1-fpm.sock
php.1.gz -> /usr/share/man/man1/php.default.1.gz
phpdbg -> /usr/bin/phpdbg8.4
phpdbg.1.gz -> /usr/share/man/man1/phpdbg8.4.1.gz

What I wonder now is if it actually was necessary to install php-fpm versions or if I just could have installed php versions and get things going by pointing the local.config.php file to:
/usr/bin/phpx.yz as I guess you stated already.
Also, maybe php-fpm works better in ubuntu debian?

@TupambAdminOrg [2024.03]

editing details for v.01
doesn't exist as an existing folder structure and/or file, at least on this standard ubuntu server installation, but was the original setting of this instance when we ported it from a friendica beta hosting service over here to a single IP VPS server with a single domain. And till now with that setting this instance ran quite well.
Where does /usr/bin/php actually point to,
]
in reply to utopiArte

@utopiArte while Ubuntu is Debian based and as such also uses the alternatives system, there are some differences (e.g. the snap packages you saw) - please read up the Ubuntu documentation for setting up a web server.

Regarding the differences of php and php-fpm see e.g. here. It depends on how you set up the server which package you need.

in reply to Tobias

please read up the Ubuntu documentation for setting up a web server

Ultimately I got this setting donated "as is", a virgin ubuntu 2022.04lts @Tobias, and with @HankG's tutorial for ubuntu I simply set it up and went on, as my general interest isn't hosting or knowing anything of all "this stuff" but to "live" decentralized social web and create content in any case. At the same time, as selfhosting your own data to own your own data is the only way to be in charge of yourself, "all this stuff" comes later on, so in any case my goal is to live "learning by doing" and documenting it if possible so others can do the same like right here and now.

Thanks for the link, I will check it out to go on with understanding bit by bit what there is to know.

Actually apparently right now the server offers me to:

The following packages were automatically installed and are no longer required:
php8.1 php8.1-intl php8.1-mysql php8.1-sqlite3 php8.1-xmlrpc


So I wonder if this is because it is/was updating to php 8.3, probably so, and at the same time if it is convenient to do so because as for I read friendica itself is working on being able to manage the different versions of php. Actually using the -fpm setup skips most likely the dependency on those ubuntu changes.
👍

in reply to Tobias

> APD package tree

A quick search was a littel bit confusing, lots of APD's out there, I guess that means:
APT package dependency tree ?

In other words, there is no reference registered in APT of the instalation for these packages (anymore).
Gone have to dig into that a little bit more.

https://askubuntu.com/questions/402589/the-following-packages-were-automatically-installed-and-are-no-longer-required

If you want to suppress the message and keep those packages installed (perhaps you're now using them), use:
apt-get install <package-name>


@Tobias

in reply to utopiArte

update for Mrs. Dodo:
Check if the installed php versions where actualy activated:
a2enmod phpX.XReplace “X.X” with the version number of the old PHP module you want to disable. For example, to disable PHP 7.2, you would run:
sudo a2dismod php7.2
Next, enable the new PHP module by running the following command:
sudo a2enmod phpX.X
Replace “X.X” with the version number of the new PHP module you want to enable. For example, to enable PHP 7.4, you would run:
sudo a2enmod php7.4
Finally, restart the Apache server to apply the changes:
sudo service apache2 restart
in reply to Tobias

Notes about Alternatives systems:

https://gist.github.com/anwas/4873797fd515c69e6f05d9e6d2880e01
# For command line
## It's important to note that there are four important PHP commands you should update if changing the default versions.
## These include php, php-config, phpdbg and phpize. So, to fully migrate to PHP 8.0, execute the following:
sudo update-alternatives --set php /usr/bin/php8.0
sudo update-alternatives --set php-config /usr/bin/php-config8.0
sudo update-alternatives --set phpdbg /usr/bin/phpdbg8.0
sudo update-alternatives --set phpize /usr/bin/phpize8.0

sudo update-alternatives --set phar /usr/bin/phar8.0
sudo update-alternatives --set phar.phar /usr/bin/phar.phar8.0

in reply to M.Scheriau

@M.Scheriau

When I enter in the console I just get a new blank line:
root@VPShosting:~# php

Same happens if I enter than
root@VPShosting:~# which php

The same is true for doing this inside the friendica folder.

Does that just mean that "I don't get a working PHP with simply calling php on the commandline" or should I worry?

Again, this is most likely related to the -fpm install and I'll have to dig into that.

in reply to Tobias

Tobias wrote:

do you have the php-cli package installed on your system?

Apparently yes @Tobias.

CLI wrote:

php-cli is already the newest version (2:8.3+95+ubuntu22.04.1+deb.sury.org+1)


btw, right now the instance(s) are working fine, so no worries, even more if you have time costrains.
Im working around this to get it in my head and right now I'm more like in a floating state of mind letting the information settle down. Once that "worst part" is over I most likely will bother with pimping up very very old instances, like 3.4.3 old instances, so you better hide somewhere and put this account into some temporary ignore and cool down mode.
:)

in reply to utopiArte

@M.Scheriau

Just now the command:
root@VPShosting:~# which php
resulted in:

/usr/bin/php

root@VPShosting:~# php -v

PHP 8.1.31 (cli) (built: Nov 21 2024 13:10:15) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.31, Copyright (c) Zend Technologies
with Zend OPcache v8.1.31, Copyright (c), by Zend Technologies

That's actually a little bit unexpected as the last setting set, if I remember well, was the one referenced in one of the comments bellow from two days ago adjusting default to 8.4:
rootname@VPShosting:~# update-alternatives --set php /usr/bin/php8.4

Maybe some settings were changed while installing the castopod instances, a installation that ultimately worked well suddenly and I actually attributed to the fact that 8.4 was activated.

In other words .. still digging into this and working on the best settings for each instance and software and which default version would be best.

in reply to utopiArte

rootname@VPShosting:~# ls -l /etc/apache2/mods-enabled/

fcgid.conf -> ../mods-available/fcgid.conf
fcgid.load -> ../mods-available/fcgid.load
Summary. Any program assigned to the handler fcgid-script is processed using the FastCGI protocol; mod_fcgid starts a sufficient number instances of the program to handle concurrent requests, and these programs remain running to handle further incoming requests.


php8.1.conf -> ../mods-available/php8.1.conf
php8.1.load -> ../mods-available/php8.1.load
LoadModule php_module /usr/lib/apache2/modules/libphp8.1.so


in reply to utopiArte

apparently changes in alternatives do not change the php version to php8.3
ls -l /etc/apache2/sites/avilable displayes:

php7.2.conf
php7.2.load
php8.1.conf
php8.1.load
php8.3.conf
php8.3.load
a2enmod to enable an Apache module a2dismod to disable a module.

root@VPShosting:~# a2enmod php7.2.conf php7.2.load php8.1.conf php8.1.load php8.3.conf php8.3.load

didn't work

print results
ERROR: Module php7.2.conf does not exist!
Considering dependency mpm_prefork for php7.2:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Considering conflict php5 for php7.2:
Enabling module php7.2.
ERROR: Module php8.1.conf does not exist!
Considering dependency mpm_prefork for php8.1:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Considering conflict php5 for php8.1:
Module php8.1 already enabled
ERROR: Module php8.3.conf does not exist!
Considering dependency mpm_prefork for php8.3:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Considering conflict php5 for php8.3:
Enabling module php8.3.
To activate the new configuration, you need to run:
systemctl restart apache2
root@VPShosting:/etc/apache2/mods-enabled# ls -l
php7.2.conf -> ../mods-available/php7.2.conf
php7.2.load -> ../mods-available/php7.2.load
php8.1.conf -> ../mods-available/php8.1.conf
php8.1.load -> ../mods-available/php8.1.load
php8.3.conf -> ../mods-available/php8.3.conf
php8.3.load -> ../mods-available/php8.3.load


root@VPShosting:~# systemctl restart apache2

Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xeu apache2.service" for details.


root@tupambae:/etc/apache2/mods-enabled# a2dismod php7.2.conf php7.2.load php8.3.conf php8.3.load

printERROR: Module php7.2.conf does not exist!
Module php7.2 disabled.
ERROR: Module php8.3.conf does not exist!
Module php8.3 disabled.
To activate the new configuration, you need to run:
systemctl restart apache2

root@tupambae:/etc/apache2/mods-enabled# systemctl restart apache2

in reply to utopiArte

@utopiArte the Apache 2 module is not affected by the PHP version that you call on the CLI. That CLI executable points to the PHP executeable of your (alternatives) choice. So php --version should give you different versions depending on the version you selected with the alternatives system.

The PHP version used by Apache2 or as fpm is set in the Apache2 configuration files.

in reply to TupambAdminOrg [2024.03]

A brief and very fast tutorial on debian ubuntu 20.04lts php and php-fpm.

Once more or less worked thru the text's here, listening to this should help assimiliating the whole story.

One of the take aways from this right now is that phpX.Y-fpm [=> -fpm] has nothing to do with the extra ppa to integrate more php versions but is at least part of ubuntu. A recheck if it's part of debian itself is still on Dodo's list, as well how to handle this on a standard debian server as ppa is a ubuntu thing (?), because most likely there is a pure debian way to achieve the same.

in reply to utopiArte

intermezzo:

Summing up right now:
On ubuntu in the case of friendica the php version the instance can or will use can be set by the conf file in:
/etc/apache2/sites-available/friendicaDomain.com.conf
or the specific friendica config file:
/var/www/friendicafolder/config/local.config.php.

In any case it's probably important to not manipulate both options but one or the other.
Could be important to have in mind what happens when the server software itself get's update or the friendica instance is updated.
In other words, one thing is if the reference goes to the general php setting of the server:
'php_path' => '/usr/bin/php'
When the server updates, the installed friendica version will have to be able to work with that newer php version.
(¿what about the recent ubuntu php update mentioned above by the ubuntu server, where exactly takes that APT check place, would an uninstall of "outdated versions" affect the general setting of different sites and php versions?)

If the friendica version get's updated but the server is stuck on an older not supported php version, there would probably occur issues too.

So one one hand there is to consider where the definition of the php path and version will be placed, on the other if the version itself should be hardcoded or left to the updates. If problems show up, in general terms the bug research does have to look the other way around, what php version is activated and where is that setting defined?

in reply to utopiArte

One of the take aways from this right now is that phpX.Y-fpm [=> -fpm] has nothing to do with the extra ppa to integrate more php versions but is at least part of ubuntu.

add-apt-repository ppa:ondrej/php

https://host4geeks.com/blog/how-to-change-default-php-version-in-ubuntu-a-step-by-step-guide/
This command adds the “ondrej/php” repository, which contains the latest PHP versions. After running the command, you’ll need to update your system’s package list:

Maybe the need for the ppa is only about the latest newest php versions and not the actual and older ones?
🤔

in reply to utopiArte

A video that explains, apparently on pure debian, that -fpm -> FastCGI actually externalizes the PHP processes from the apache server and also sums up how to set it up correctly.

So on one hand there is installing different PHP versions, in that regard the -fpm PPA ppa:ondrej/php adds access to newer PHP versions that are still in development branch and than there is the fact that php-fpm itself at the same time is a specific independent version of PHP that separates the PHP handling and processes from the apache server and gives more options to tweak and speed up the PHP processes.

in reply to utopiArte

One of the take aways from this right now is that phpX.Y-fpm [=> -fpm] has nothing to do with the extra ppa

fpm = FastCGI Process Manager (FPM)

php.net/manual/en/install.fpm.…

syslog.ident string
Prepended to every message. If you have multiple FPM instances running on the same server, you can change the default value which must suit common needs. Default value: php-fpm.

This setting might address (somehow part of) the tweaking settings "editing php.ini" of friendica and at the same time the specific needs we'll have for example for castopod as we want to host a subdomain of that software for video and audio publications in the fediVerse and there for will need quite high values in terms of MB's, especially for videos.
Also, is there a way to define different values for different sites in the same php version configuration file?
(most likely)

listen string
The address on which to accept FastCGI requests. Valid syntaxes are: 'ip.add.re.ss:port', 'port', '/path/to/unix/socket'. This option is mandatory for each pool.

specific IP or ¡domain! setting?
(for example for a video hosting site setting?)

That list goes on and on so we'll have to search first for what we want to do before checking into it in any case.

in reply to utopiArte

The digitalocean tutorial used inicially displayed two entries as variation of the standard entry in a sitedomain.registry.conf file robably only the second is/was neccessary fior the correct setup of php, this has to be checked again, for the friendica sites and the castopod site.

Entry that actually (probably) isn't about the php setting:

 <Directory /var/www/site1.your_domain>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
     </Directory>

Entry that affects the php entry:

    <FilesMatch \.php$>
        # From the Apache version 2.4.10 and above, use the SetHandler to run PHP as a fastCGI process server
         SetHandler "proxy:unix:/run/php/php7.2-fpm.sock|fcgi://localhost"
    </FilesMatch>
in reply to TupambAdminOrg [2024.03]

To PHP, to PHP-fpm or both .. that's the question!

Trying to visualize the whole setup and questions regarding PHP to figure out what options are best.

Given the fact that more than one php version is installed, it is precise to tell the server what php version to use:

  • for the server in general
  • for the specific domain


Does update-alternatives fix this setting for the server in general when ever there is no specific option mentioned in the domain.com.conf file or does this setting over-ride/over-rule settings in domain.com.conf and/or local.config.php?
(it probably does not over-rule specific settings)

The friendica instalation help page states:

You can combine environment variables and options, but be aware that options are prioritized over environment variables.
Friendica settings
This variables [The following variables(?)] wont be used at normal Friendica runtime. Instead, they get saved into config/local.config.php.
FRIENDICA_PHP_PATH The path of the PHP binary


Can different settings in different places like:
/etc/alternatives/
/etc/apache2/sites-enabled/domain.com.conf
/var/www/domainfolder/bin/console config
and/or
crontab -e
create conflicts, slow down the server, become kind a fall back option or even create vulnerabilities?

  • conflicts
    maybe
  • slow down the server
    probably
  • become kind a fall back option
    perhaps
  • create vulnerabilities
    most likely

Can there actually be no standard setting in place at all as default php?
(probably not)

Is it possible to not define the php version in domain.com.conf and instead define it in:
/var/www/domainfolder/config/local.config.php
as
'php_path' => '/usr/bin/php.8.2/fpm'
as the php handler and in the case of the cron job call/define:
/usr/bin/php.8.2/fpm
instead of
/usr/bin/php
for the /var/www/domainfolder/bin/worker.php to use?

in reply to TupambAdminOrg [2024.03]

@TupambAdminOrg [2024.03] you need two PHP's - or better say two ways to call it. The one that is called by the webserver directly (this is either php-fpm or the mod_php in case of Apache2 servers) and the other one in the terminal PHP that is called by the background job. Both should have the same version.

The one in the Friendica config is the client version for the background jobs. That will be used for the long running background processes. In the web server config files you define the one used by the foreground processes.

in reply to TupambAdminOrg [2024.03]

v.01
!Friendica Support
#friendicaPHP-fpm Q&A @Tutorial

deadlink

DIY standard procedures - best practiceOpen a minimalistic text editor of your choice (e.g. mousepad/kate) to store basic and important information of your interaction with the CLI (console).
Backup the commands and copy/paste notes of the basic results as well as information of your search and queries.

checking the existing settings before any modificationrootname@VPShosting:~# sudo php -v
rootname@VPShosting:~# sudo php --version
rootname@VPShosting:~# sudo php
rootname@VPShosting:~# sudo which php
rootname@VPShosting:~# sudo ls -l /usr/bin/
rootname@VPShosting:~# sudo ls -l /etc/alternatives/
system up to date check

rootname@VPShosting:~# sudo apt get update
rootname@VPShosting:~# sudo apt get upgrade
eventually
rootname@VPShosting:~# sudo apt get dist-upgrade

adding PHP-fpm PPA to the systemif you havent already added php-fpm PPA to your system
add PPA's as sources to the system
add the PHP-fpm PPA to the system
rootname@VPShosting:~# sudo install software-properties-common
rootname@VPShosting:~# sudo add-apt-repository ppa:ondrej/php
standard instalation of specific php modules for friendica using PHP-fpmThis list is from the install tutorial in progress:
Install and/or move friendica 2023.05 to ubuntu 22.04 LTS VPS server

rootname@VPShosting:~# sudo sudo apt install php php-fpm libapache2-mod-php php-common php-gmp php-curl php-intl php-mbstring php-xmlrpc php-mysql php-gd php-imagick php-xml php-cli php-zip php-sqlite3


Changes in friendica over time
php specific mentions in changelog of the friendica github repo over timeVersion 2024.03 (2024-03-21)
Improved PHP 8.2 compatibility
[MrPetovan] Friendica Addons
advancedcontentfilter
Updated dependency for PHP8.2 compatibility
[MrPetovan]Version 2023.12 (2023-12-24)
Friendica Core
Raised minimal PHP version to 7.4
Version 2022.12 (2022-12-20)
Improved the PHP 8.1 compatibility
[MrPetovan]Version 2022.02 (2022-02-06)
Friendica Core
Bumped the minimal version of PHP to 7.3
Friendica Addons
securemail
Updated dependencies to enhance the PHP8 support
[MrPetovan]Version 2021.07 (2021-07-04)
Friendica Core
Enhanced the support of PHP8 [nupplaphil, MrPetovan]
Version 2021.04 (2021-04-26)
Friendica Core
Enhanced the PHP8 compatibility [annando, nupplaphil, realkinetix]
Version 2021.01 (2021-01-04)
Friendica Core
Enhanced PHP8 compatibility
[annando]Version 2018.09 (2018-09-23)
Friendica Core:
Enhancements to the PHP7.2 compatibility [annando, miqrogroove, MrPetovan]
Friendica Addons:
Directory:
Enhancements of the PHP7 compatibility
[MrPetovan]Version 2018.05 (2018-06-01)
Friendica Core:
Enhancements to the PHP7.2 compatibility [Alkarex, MrPetovan, Quix0r]
Fixed wrong version of a dependency preventing the usage of PHP 5.6
[MrPetovan]Version 3.5.4 (2017-10-16)
Friendica Core:
Update the DB handling for support of PHP 7.1
[annando]Version 3.5.2 (2017-06-06)
Friendica Core:
Improved php7 support
[annando]Version 3.5.1 (2017-03-12)
Friendica Core:
Work on PHP7 compatibility
[ddorian1]Version 3.3
System stuff
no more apc support due problems with PHP 5.5

Specific installation instruction for:
friendica 3.4.3friendica 3.4.3 and Addons:
Instalation Instructions Requirements:
Apache with mod-rewrite enabled and "Options All" so you can use a
local .htaccess file PHP 5.2+. The later the better. PHP 5.3 is required for communications
with the Diaspora network and improved security. PHP *command line* access with register_argc_argv set to true in the
php.ini file - (cli,) curl, gd (with at least jpeg support), mysql, mbstring, mcrypt,
and openssl extensions ?
- Mysql 5.x ?
relevant changelog entries 3.4.3 to 3.6 - github.com/friendica/friendica…
Version 3.5.4 (2017-10-16)
Friendica Core:
Update the DB handling for support of PHP 7.1
[annando]Version 3.5.2 (2017-06-06)
Friendica Core:
Improved php7 support
[annando]Version 3.5.1 (2017-03-12)
Friendica Core:
Work on PHP7 compatibility
[ddorian1]Version 3.3
System stuff
no more apc support due problems with PHP 5.5
friendica 2019.12Github tree 2019.12
Requirements
Apache with mod-rewrite enabled and "Options All" so you can use a local .htaccess file
PHP 7+ (PHP 7.1+ is recommended for performance and official support)
PHP command line access with register_argc_argv set to true in the php.ini file
Curl, GD, PDO, MySQLi, hash, xml, zip and OpenSSL extensions
The POSIX module of PHP needs to be activated (e.g. RHEL, CentOS have disabled it)
some form of email server or email gateway such that PHP mail() works
MySQL 5.6+ or an equivalent alternative for MySQL (MariaDB, Percona Server etc.)
relevant changelog entries 2019.12github.com/friendica/friendica… 2018.09 (2018-09-23)Friendica Core:
Enhancements to the PHP7.2 compatibility [annando, miqrogroove, MrPetovan]
2021.01 | apparently no changes to 2019.12Github tree 2021.01
Requirements
Apache with mod-rewrite enabled and "Options All" so you can use a local .htaccess file
PHP 7+ (PHP 7.1+ is recommended for performance and official support)
PHP command line access with register_argc_argv set to true in the php.ini file
Curl, GD, PDO, MySQLi, hash, xml, zip and OpenSSL extensions
The POSIX module of PHP needs to be activated (e.g. RHEL, CentOS have disabled it)
some form of email server or email gateway such that PHP mail() works
MySQL 5.6+ or an equivalent alternative for MySQL (MariaDB, Percona Server etc.)
PHP 7.1+
Curl, GD, PDO, MySQLi, hash, xml, zip and OpenSSL extensions
relevant changelog entries 2021.01github.com/friendica/friendica… 2021.01 (2021-01-04)
Friendica Core
Enhanced PHP8 compatibility [annando]
2021.04 | apparently no changes to 2021.01Github tree 2021.04
Requirements
Apache with mod-rewrite enabled and "Options All" so you can use a local .htaccess file
PHP 7+ (PHP 7.1+ is recommended for performance and official support)
PHP command line access with register_argc_argv set to true in the php.ini file
Curl, GD, PDO, MySQLi, hash, xml, zip and OpenSSL extensions
The POSIX module of PHP needs to be activated (e.g. RHEL, CentOS have disabled it)
some form of email server or email gateway such that PHP mail() works
MySQL 5.6+ or an equivalent alternative for MySQL (MariaDB, Percona Server etc.)
relevant changelog entries 2021.04github.com/friendica/friendica…
Version 2021.04 (2021-04-26)
Friendica Core
Enhanced the PHP8 compatibility [annando, nupplaphil, realkinetix]
2023.05Github tree 2023.05
Requirements
Apache with mod-rewrite enabled and "Options All" so you can use a local .htaccess file
PHP 7.3+ (PHP8 is not fully supported yet)
PHP command line access with register_argc_argv set to true in the php.ini file
Curl, GD, GMP, PDO, mbstrings, MySQLi, hash, xml, zip and OpenSSL extensions
The POSIX module of PHP needs to be activated (e.g. RHEL, CentOS have disabled it)
Some form of email server or email gateway such that PHP mail() works. If you cannot set up your own email server, you can use the phpmailer addon and use a remote SMTP server.
relevant changelog entries 2023.05github.com/friendica/friendica…
Version 2022.02 (2022-02-06)
Friendica Core
Bumped the minimal version of PHP to 7.3
Friendica Addons
securemail
Updated dependencies to enhance the PHP8 support
[MrPetovan]Version 2021.07 (2021-07-04)
Friendica Core
Enhanced the support of PHP8 [nupplaphil, MrPetovan]
2024.12Github tree 2023.05
Requirements
Apache with mod_rewrite enabled and "AllowOverride All" so you can use a local .htaccess file
PHP 7.4+
PHP command line access with register_argc_argv set to true in the php.ini file
Curl, GD, GMP, PDO, mbstring, MySQLi, xml, zip, IntlChar, IDN and OpenSSL extensions
The POSIX module of PHP needs to be activated (e.g. RHEL, CentOS have disabled it)
Some form of email server or email gateway such that PHP mail() works. If you cannot set up your own email server, you can use the phpmailer addon and use a remote SMTP server.
MySQL with support of InnoDB and Barracuda (we suggest a MariaDB server as all development is done using these, but alternatives like MySQL or Percona Server etc. might work as well)
relevant changelog entries 2024.12github.com/friendica/friendica…
Version 2024.03 (2024-03-21)
Improved PHP 8.2 compatibility
[MrPetovan] Friendica Addons
advancedcontentfilter
Updated dependency for PHP8.2 compatibility
[MrPetovan]Version 2023.12 (2023-12-24)
Friendica Core
Raised minimal PHP version to 7.4
Version 2022.12 (2022-12-20)
Improved the PHP 8.1 compatibility [MrPetovan]

The following are adapted lists of modules for older versions of friendica so they can run in a PHP-fpm setup.

php-fpm version php8.1all avilabel modules:
php8.1 php8.1-cli php8.1-common php8.1-dev php8.1-fpm php8.1-cgi libphp8.1-embed php8.1-phpdbg php8.1-readline php8.1-curl php8.1-mysql php8.1-sqlite3 php8.1-pgsql php8.1-imap imagemagick php8.1-imagick php8.1-gd memcached php8.1-memcached php8.1-memcache php8.1-opcache php-apcu php-apcu-bc php8.1-apcu php8.1-igbinary php8.1-mcrypt php8.1-bcmath php8.1-zip php8.1-bz2 xml2 php8.1-xml php8.1-tidy php8.1-xsl php8.1-intl php8.1-mbstring php8.1-pspell php8.1-ldap php8.1-soap php8.1-xmlrpc php-pear pkg-php-tools shtool dh-php dh-make php-geoip libruby
libapache2-mod-php8.1 libapache2-mod-fcgid apache2-suexec-pristine libapache2-mod-python
Use the following command to search available PHP 8 modules in the package repository.
sudo apt-cache search php8*
Adjustet modules list for a PHP8.1-fpm instalation for friendica 2023.05 to friendica 2024.12 using version php8.1 (as of writing):
basic modules to work with and run properly php8.1-fpmlibapache2-mod-php -> to run PHP scripts on apache, necessary for -fpm?
libapache2-mod-fcgid -> unclear if necessary for -fpm
php8.1 -> standard PHP
php8.1-fpm -> standard PHP-spm module
php8.1-mysql -> Allows PHP to interact with MySQL databases
php8.1-cgi -> run PHP scripts without apache PHP module
php8.1-cli -> run PHP scripts from the command line
rootname@VPShosting:~# sudo apt install libapache2-mod-php8.1 php8.1 php8.1-fpm php8.1-cgi php8.1-cli php8.1-mysql
specific additional modules to run friendica with php8.1-fpmphp8.1-common ->
php8.1-curl -> URL transfer in PHP applications
php8.1-gd -> image processing
php8.1-imagick ->
php8.1-intl ->
php8.1-mbstring -> support for UTF-8 text formats
php8.1-sqlite3 ->
php8.1-xml -> XML support
php8.1-xmlrpc ->
php8.1-zip -> ZIP file support
rootname@VPShosting:~# sudo apt install php8.1-common php8.1-curl php8.1-gd php8.1-intl php8.1-zip php8.1-xml php8.1-xmlrpc php8.1-imagick php8.1-mbstring php8.1-sqlite3
some more optional basic modules for php8.1-fpm:php8.1-phpdbg ->
hp8.1-imap ->
imagemagick ->
php8.1-mcrypt ->
php8.1-json ->
rootname@VPShosting:~# sudo apt install php8.1-phpdbg php8.1-imap imagemagick php8.1-mcrypt php8.1-json
activate php8.1-fpmenable php8.1
restart the apache server to initialize the changes
rootname@VPShosting:~# sudo a2enconf php8.1-fpm]
rootname@VPShosting:~# sudo systemctl restart apache2

php7.Xy specific notesphp-imagick = [-imagick] is php-version specific present since php7.4-imagick.
before it's moste likely necessary to install imagemagick(?)
2019.12 mentions the module "hash" ?
OpenSSL extensions ?
List of php7.Xy-fpm specific modules not mentioned in the install instructionsrootname@VPShosting:~# sudo apt install php7.2-fpm
List of modules mentioned in the github and/or the friendica ubuntu server install instructionsrootname@VPShosting:~# sudo apt install libapache2-mod-php7.2 php7.2 php7.2-common php-gmp php7.2-intl php7.2-mbstring php-xmlrpc php7.2-gd php7.2-mysql php7.2-zip php7.2-curl php7.2-xml php7.2-cli php7.2-sqlite3
List of php7.Xy-fpm modules not mentioned in the install instructions but present in newer versions of friendica (?)Adjustet modules list for a PHP-fpm instalation for earliest friendica versions running from php7.Xy forward or somehow already installed (/):
rootname@VPShosting:~# sudo apt install phpmyadmin imagemagick

very old friendica versions using php5.6modules list for a PHP-fpm instalation for earliest friendica versions running php5.6.
Notes php5.6-fpmThe following modules do not exist in php5.6 as specific version modul: php-imagick
Specific installtion instruction for friendica 3.4.3 and Addons
Instalation Instructions Requirements:
Apache with mod-rewrite enabled and "Options All" so you can use a
local .htaccess file PHP 5.2+. The later the better. PHP 5.3 is required for communications
with the Diaspora network and improved security. PHP *command line* access with register_argc_argv set to true in the
php.ini file - (cli,) curl, gd (with at least jpeg support), mysql, mbstring, mcrypt,
and openssl extensions ?
- Mysql 5.x ?
complete list of php5.6-fpm modulesphp5.6 php5.6-common php5.6-gd php5.6-mysql php5.6-imap phpmyadmin php5.6-cli php5.6-cgi libapache2-mod-fcgid apache2-suexec-pristine php-pear mcrypt imagemagick libruby libapache2-mod-python php5.6-curl php5.6-intl php5.6-pspell php5.6-recode php5.6-sqlite3 php5.6-tidy php5.6-xmlrpc php5.6-xsl memcached php-memcache php-imagick php-gettext php5.6-zip php5.6-mbstring php5.6-opcache php5.6-json php5.6-ldap php5.6-soap php5.6-bz2 php5.6-bcmath php5.6-xml php5.6-dev php5.6-fpm php5.6-phpdbg php-apcu dh-php php5.6-readline pkg-php-tools shtool xml2
list of modules extracted from the list above that don't have a php5.6 prefixphpmyadmin libapache2-mod-fcgid apache2-suexec-pristine php-pear mcrypt imagemagick libruby libapache2-mod-python memcached php-memcache php-imagick php-gettext php-apcu dh-php pkg-php-tools shtool xml2
List of php5.6-fpm specific modules not mentioned in the install instructionsrootname@VPShosting:~# sudo apt install php5.6-fpm
List of php5.6-fpm modules mentioned in the github and/or the friendica ubuntu server install instructionsrootname@VPShosting:~# sudo apt install php5.6-cli php5.6-curl php5.6-gd php5.6-mysql php5.6-mbstring mcrypt
List of php5.6-fpm modules not mentioned in the install instructions but present in newer versions of friendica (?)rootname@VPShosting:~# sudo apt install php5.6 php5.6-common php5.6-sqlite3 php5.6-imap php5.6-intl php5.6-xml php5.6-zip php5.6-json php5.6-xmlrpc

standard information of platform specific settings in phpX.Yz.ini of phpX.Yz-fpm
changes in platform specific settings in phpX.Yz.ini of phpX.Yz-fpm

standard information of platform specific settings in platform specific files
changes in platform specific settings in platform specific files
standard settings in configuration files of domains

check the existing settings after the modificationrootname@VPShosting:~# sudo php -v
rootname@VPShosting:~# sudo php --version
rootname@VPShosting:~# sudo php
rootname@VPShosting:~# sudo which php
rootname@VPShosting:~# sudo ls -l /usr/bin/
rootname@VPShosting:~# sudo ls -l /etc/alternatives/

deadlink
in reply to TupambAdminOrg [2024.03]

Looks like it's starting to work out!

First publication of the #castoPod subdomain hosted on this very VPS server. This answer contains actually a direct link to a video snippet created on the instance and hosted on the instance. The setup is a littel weird, more like have way to the final goal, but with some work arounds usefull, including for the hosting of videos.