New note by admin
https://tupambae.org/display/0ac...v.01
!Friendica Support
#friendicaPHP-fpm Q&A @Tutorial
https://deadlink
DIY standard procedures - best practice
Open 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 modification
rootname@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/
rootname@VPShosting:~# sudo apt-cache search php*
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 system
if 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-fpm
This list is from the install tutorial in progress:
Install and/or move friendica 2023.05 to ubuntu 22.04 LTS VPS server https://tupambae.org/display/0ac89072-9365-5d9d-8485-599077309156rootname@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 time
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]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.3
friendica 3.4.3 https://github.com/friendica/friendica/tree/3.4.3 and https://github.com/friendica/friendica-addons/tree/3.1:
Instalation Instructions Requirements https://github.com/friendica/friendica/blob/3.4.3/INSTALL.txt:
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 -
https://github.com/friendica/friendica/blob/3.4.3/CHANGELOG
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.5friendica 2019.12
Github tree 2019.12 https://github.com/friendica/friendica/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.12
https://github.com/friendica/friendica/blob/2019.12/CHANGELOG]Version 2018.09 (2018-09-23)Friendica Core:
Enhancements to the PHP7.2 compatibility [annando, miqrogroove, MrPetovan]2021.01 | apparently no changes to 2019.12
Github tree 2021.01 https://github.com/friendica/friendica/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.01
https://github.com/friendica/friendica/blob/2021.01/CHANGELOG]Version 2021.01 (2021-01-04)
Friendica Core
Enhanced PHP8 compatibility [annando]2021.04 | apparently no changes to 2021.01
Github tree 2021.04 https://github.com/friendica/friendica/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.04
https://github.com/friendica/friendica/blob/2021.04/CHANGELOG
Version 2021.04 (2021-04-26)
Friendica Core
Enhanced the PHP8 compatibility [annando, nupplaphil, realkinetix]2023.05
Github tree 2023.05 https://github.com/friendica/friendica/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.05
https://github.com/friendica/friendica/blob/2023.05/CHANGELOG
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.12
Github tree 2023.05 https://github.com/friendica/friendica/tree/2024.12
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.12
https://github.com/friendica/friendica/blob/2024.012/CHANGELOG
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.1
all 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:
rootname@VPShosting:~# sudo 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-fpm
libapache2-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-fpm
php8.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-fpm
enable php8.1
restart the apache server to initialize the changes
rootname@VPShosting:~# sudo a2enconf php8.1-fpm
]
rootname@VPShosting:~# sudo systemctl restart apache2
php-fpm version php7.Xy
php7.Xy specific notes
php-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 ?
Use the following command to search available PHP 7 modules in the package repository.
rootname@VPShosting:~# sudo apt-cache search php7*
List of php7.Xy-fpm specific modules not mentioned in the install instructions
rootname@VPShosting:~# sudo apt install php7.Xy-fpm
List of modules mentioned in the github and/or the friendica ubuntu server install instructions
rootname@VPShosting:~# sudo apt install libapache2-mod-php7.Xy php7.Xy php7.Xy-common php-gmp php7.Xy-intl php7.Xy-mbstring php-xmlrpc php7.Xy-gd php7.Xy-mysql php7.Xy-zip php7.Xy-curl php7.Xy-xml php7.Xy-cli php7.Xy-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.6
modules list for a PHP-fpm instalation for earliest friendica versions running php5.6.
Notes php5.6-fpm
The following modules do not exist in php5.6 as specific version modul: php-imagick
Specific installtion instruction for friendica 3.4.3 https://github.com/friendica/friendica/tree/3.4.3 and https://github.com/friendica/friendica-addons/tree/3.1
Instalation Instructions Requirements https://github.com/friendica/friendica/blob/3.4.3/INSTALL.txt:
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 ?
Use the following command to search available PHP 5 modules in the package repository.
rootname@VPShosting:~# sudo apt-cache search php5*
complete list of php5.6-fpm modules
php5.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 prefix
phpmyadmin 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 instructions
rootname@VPShosting:~# sudo apt install php5.6-fpm
List of php5.6-fpm modules mentioned in the github and/or the friendica ubuntu server install instructions
rootname@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 modification
rootname@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/
rootname@VPShosting:~# sudo apt-cache search php*
https://deadlink16.3.2025 01:27New note by admin
https://tupambae.org/display/0ac...New note by admin
https://tupambae.org/display/0ac...v.04
!Friendica Support
#friendica Q&A @Tutorial
https://deadlink
questions to solve
How does the setting:
'php_path' =>
, definable in the /config/local.config.php
or by the console via /bin/console config
work exactly?
What is php-gmp?
It figures in standard php modules installation of the friendica tutorial, apparently it is not available in -fpm:
What about the following modules:
gist.github.com/anwas/4873797f…
These modules figure for apache2 but apparently have no comparable -fpm version:
libapache2-mod-php
libapache2-mod-fcgid
Are these just "some libraries that are used (or not?). Intro | what is PHP
PHP is the "P" in any LAM"P" installation and there for a main part of the back bone of apache web servers. It is a general-purpose scripting language geared towards web development https://en.wikipedia.org/wiki/PHP and one of the main actors not only in providing functionality to a website and the services it provides but also responsible for the speed and responsiveness of the service provided. At the same time it's correct implementation as well as version and services used is in part a main ingredient of the security and the reliability of the whole system, so changes as well as the main initial decisions about the general setup itself define even chances of creating vulnerabilities of the entire setup.Reasons and goals of modifying the standard PHP settings of a basic LAMP server
This tutorial was created in view of modifying a standard single domain VPS installation, in this case a setup created for a friendica fediVerse node. The goal is to activate PHP-fpm as the provider for the PHP services of the LAMP installation, the apache2 server. Also part of the intention is to become able to vary the PHP version for the respective domain and the respective platform version that is using it, becoming independent of standard updates of the PHP version by the server environment, preventing incompatibilities out of automated updating procedures. As the intention is to create a VPS environment that serves several domains with different platforms, or platform versions, it is necessary to be able to install and use different PHP versions that fit the specific development stages and needs of the respective platforms.

Why PHP-fpm
PHP-fpm is a modification of the standard PHP setup in LAMP servers, adding certain capabilities that allow on one hand more specific settings, including options to speed up processes, while taking certain risks in security and vulnerability of the system as the code and options increase. It is a widely used modification in the LAMP server environment with an evolution of over two decades to the point that it has evolved into being even considered as a basic integration into the standard apache LAMP server setup. As for now it is not part of the basic debian setup and it's repository has to be added by a specific PPA, a fact that adds the need to add the option of adding PPA's to a basic debian system. PPA's are a source to add extra features with repos not included in the debian main distribution. They are a standard in ubuntu and have become common in the GNU-linux debian environment. It is necessary, and probably always will be necessary, to add the PPA function itself to the basic debian setup, as the main goal of debian itself is to be a simple and restricted backbone where additional well defined tools can be added as needed.
Main functions of PHP-fpm:- separating the PHP process from the apache server
- speeding up processes by allowing to run multiple processes at the same time
- adjusting and fine tuning multiple processes depending on the capabilities of the hardware
- adjusting and fine tuning processes depending on the capabilities of the respective platforms
- enabling the use of different php versions for different domains and there for different platforms or different platform versions.
- adding access to PHP versions that are still in development and not at disposition in standard stable release of a server software which normally is designed to create a stable and reliable production environment for VPS server, enabling setups for the development of software and platforms.
DIY standard procedures - best practice
Open 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 modification
rootname@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/
adding PHP-fpm PPA to the system
check that your system is up to date
add PPA's as sources to the system
add the PHP-fpm PPA to the systemrootname@VPShosting:~# sudo apt get update
rootname@VPShosting:~# sudo apt get upgrade
rootname@VPShosting:~# sudo install software-properties-common
rootname@VPShosting:~# sudo add-apt-repository ppa:ondrej/php
default installation of php and php-fpm specific files
libapache2-mod-php -> to run PHP scripts on apache, necessary for -fpm?
libapache2-mod-fcgid -> unclear if necessary for -fpm
php -> standard PHP
php-fpm -> standard PHP-spm module
php-mysql -> Allows PHP to interact with MySQL databases
php-cgi -> run PHP scripts without apache PHP module
php-cli -> run PHP scripts from the command linerootname@VPShosting:~# sudo apt install libapache2-mod-php libapache2-mod-fcgid php php-fpm php-mysql php-cgi php-cli
specific additional modules to run friendica
php-common ->
php-curl -> URL transfer in PHP applications
php-gd -> image processing
php-imagick ->
php-intl ->
php-mbstring -> support for UTF-8 text formats
php-sqlite3 ->
php-xml -> XML support
php-xmlrpc ->
php-zip -> ZIP file supportrootname@VPShosting:~# sudo apt install php-common php-curl php-gd php-imagick php-intl php-mbstring php-sqlite3 php-xml php-xmlrpc php-zip
some more optional basic modules:
php-phpdbg ->
php-imap ->
imagemagick ->
php-mcrypt ->
php-json ->
rootname@VPShosting:~# sudo apt install php-phpdbg php-imap imagemagick php-mcrypt php-json
enable apache php-fpm modules and activate PHP-fpm
proxy_fcgi: connect apache with PHP-fpm as a proxy server
setenvif: setting environment variables inbetween apache and PHP-fpm
enable the default PHP-fpm configuration
restart the apache server to initialize the changesrootname@VPShosting:~# sudo a2enmod proxy_fcgi setenvif
rootname@VPShosting:~# sudo a2enconf php-fpm
rootname@VPShosting:~# sudo systemctl restart apache2
standard instalation of a specific php-fpm version | example php7.4
all avilabel modules:
php7.4 php7.4-cli php7.4-common php7.4-dev php7.4-fpm php7.4-cgi libphp7.4-embed php7.4-phpdbg php7.4-readline php7.4-curl php7.4-mysql php7.4-sqlite3 php7.4-pgsql php7.4-imap imagemagick php7.4-imagick php7.4-gd memcached php7.4-memcached php7.4-memcache php7.4-opcache php-apcu php-apcu-bc php7.4-apcu php7.4-apcu-bc php7.4-igbinary php7.4-mcrypt php7.4-bcmath php7.4-zip php7.4-bz2 xml2 php7.4-xml php7.4-tidy php7.4-xsl php7.4-json php7.4-intl php7.4-mbstring php7.4-pspell php7.4-ldap php7.4-soap php7.4-xmlrpc php-pear pkg-php-tools shtool dh-php dh-make php-geoip php7.4-geoip libruby
Use the following command to search available PHP 7 modules in the package repository.
sudo apt-cache search php7*basic modules to work with and run properly php7.4-fpm
libapache2-mod-php -> to run PHP scripts on apache, necessary for -fpm?
libapache2-mod-fcgid -> unclear if necessary for -fpm
php7.4 -> standard PHP
php7.4-fpm -> standard PHP-spm module
php7.4-mysql -> Allows PHP to interact with MySQL databases
php7.4-cgi -> run PHP scripts without apache PHP module
php7.4-cli -> run PHP scripts from the command linerootname@VPShosting:~# sudo apt install libapache2-mod-php7.4 php7.4 php7.4-fpm php7.4-cgi php7.4-cli php7.4-mysql
specific additional modules to run friendica
php7.4-common ->
php7.4-curl -> URL transfer in PHP applications
php7.4-gd -> image processing
php7.4-imagick ->
php7.4-intl ->
php7.4-mbstring -> support for UTF-8 text formats
php7.4-sqlite3 ->
php7.4-xml -> XML support
php7.4-xmlrpc ->
php7.4-zip -> ZIP file supportrootname@VPShosting:~# sudo apt install php7.4-common php7.4-curl php7.4-gd php7.4-intl php7.4-zip php7.4-xml php7.4-xmlrpc php7.4-imagick php7.4-mbstring php7.4-sqlite3
some more optional basic modules:
php7.4-phpdbg ->
hp7.4-imap ->
imagemagick ->
php7.4-mcrypt ->
php7.4-json ->
rootname@VPShosting:~# sudo apt install php7.4-phpdbg php7.4-imap imagemagick php7.4-mcrypt php7.4-json
activate php7.4-fpm
enable php7.4
restart the apache server to initialize the changesrootname@VPShosting:~# sudo a2enconf php7.4-fpm
rootname@VPShosting:~# sudo systemctl restart apache2
check the existing settings after the modification
rootname@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/
Links to howTo's, DIY's, tutorials and other additional information on the web
apache2
debian PHP
ubuntu PHP
PHP-fpm
https://www.digitalocean.com/community/tutorials/how-to-install-lamp-stack-on-ubuntu
https://www.digitalocean.com/community/tutorials/how-to-install-php-7-4-and-set-up-a-local-development-environment-on-ubuntu-20-04
learn-how-to-install-lamp-PHP-FPM-on-ubuntu-22-04 https://accuweb.cloud/blog/learn-how-to-install-lamp-on-ubuntu-22-04/
lidaobing/php-fpm.conf https://gist.github.com/lidaobing/673798
[Multiple PHP versions on Ubuntu]anwas/multiple-php.txt | #php #dev #ispconfig https://gist.github.com/anwas/4873797fd515c69e6f05d9e6d2880e01#file-multiple-php-txt-L10v.02
How does the setting:
'php_path' =>
, definable in the /config/local.config.php
or by the console via /bin/console config
work exactly?
command and code recollection till now:
/usr/bin/
/usr/bin/phpX.YZ
/etc/php/8.1/fpm
specific (changeable)settings of the specific php version
/etc/php/8.1/apache2/php.ini
commands in CLI (console)
crontab -e
php -v
php --version
ls -l
successive (?):
php
which php
check that php-cli
is installed
/var/www/domainfolder/bin/console config
ls -l /usr/bin/
ls -l /usr/bin/
php -> /etc/alternatives/php
php.default -> php8.3
php5.6
php7.2
php8.1
php8.3
php8.4
phpdbg -> /etc/alternatives/phpdbg
phpdbg8.4ls -l /etc/alternatives/
ls -l /etc/alternatives/
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.gzupdate-alternatives --set php /usr/bin/php8.4
update-alternatives --config php
update-alternatives --config php
There are 6 choices for the alternative php (providing /usr/bin/php).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/php.default 100 auto mode
1 /usr/bin/php.default 100 manual mode
2 /usr/bin/php5.6 56 manual mode
3 /usr/bin/php7.2 72 manual mode
* 4 /usr/bin/php8.1 81 manual mode
5 /usr/bin/php8.3 83 manual mode
6 /usr/bin/php8.4 84 manual mode
Press <enter> to keep the current choice
, or type selection number:]
add-apt-repository ppa:ondrej/php
/etc/apache2/mods-available/
/etc/apache2/mods-enabled/
a2enmod php7.4
a2dismod php7.2
a2enmod actions fcgid alias proxy_fcgi
/etc/apache2/sites-available/
/etc/apache2/sites-enabled/
a2ensite domain.com.conf
a2dissite domain.com.conf
service apache2 restart
service apache2 reload
(?)
systemctl restart apache2
systemctl status apache2
systemctl status php7.2-fpm
systemctl start php7.2-fpm
prints
PHP version 8.1.31 php.ini /**/8.1/fpm/php.ini
definitions/rules/settings in files
'php_path' =>
'php_path' => '/usr/bin/php'
'php_path' => '/etc/php/8.1/fpm/'
{crontab-worker}
files
/var/www/domainfolder/config/local.config.php
/etc/apache2/sites-available/domain.com.conf
questions to solve
are the php mods actions fcgid alias proxy_fcgi
activated or not?
How would a complete setup as mod_php look like?
How would a complete setup as php-fpm look like?
What is the actual setup?
What is enabled?
Why doesn't castopod enable videos?
Is ffmpeg installed? (most likely) to check out
syslog.ident string
(?)
And than there is also the PPA sudo add-apt-repository ppa:ondrej/apache2, actually not mentioned anywhere else (what for?):
gist.github.com/anwas/4873797f…
some info
f you want to suppress the message and keep those packages installed (perhaps you're now using them), use:
apt-get install "package-name"
Notes about Alternatives systems
gist.github.com/anwas/4873797f…
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
related:
how to install friendica on ubuntu VPS https://tupambae.org/display/0ac89072-9365-5d9d-8485-599077309156
castpod install https://tupambae.org/display/0ac89072-9667-bd12-8d5f-009398772525
mySQL https://tupambae.org/display/0ac89072-1167-c2c5-0bf3-c67042286025
Creating several friendica instances and other websites as sub/domains on one VPS with one IP https://tupambae.org/display/0ac89072-2067-b924-10c3-0df887087646v.01
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 https://www.digitalocean.com/community/tutorials/how-to-run-multiple-php-versions-on-one-server-using-apache-and-php-fpm-on-ubuntu-20-04 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 https://github.com/friendica/friendica/.
There for the way the php version used for the different friendica versions is crucial to make things work in the first place. https://deadlink15.3.2025 21:35New note by admin
https://tupambae.org/display/0ac...New note by admin
https://tupambae.org/display/0ac...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?
14.3.2025 05:13New note by admin
https://tupambae.org/display/0ac...New note by admin
https://tupambae.org/display/0ac...!Friendica Support !Friendica Admins
This help request is somehow solved. There were serious errores in different /etc/apache2/sites-available/defaultANDdomain.conf
files introduced by hand and unchecked copy/paste practices.
Still having some troubles to get this work but at least there is some progress for now.
original halp request
Hi there.
Trying right now to install a new friendica instance on another domain [tupambae.com] alongside this installation [tupambae.org] here.
This ubuntu 2022.04lts was installed initially as a single instance VPS with the following tutorial (in progress):
tupambae.org /display/0ac89072-9365-5d9d-8485-599077309156
The following changes were made to transform this VPS into a domain name-based single IP virtual hosting:
tupambae.org/display/0ac89072-…
This installation process right now is documented in this post:
tupambae.org/display/0ac89072-…
This intent got stuck after executing the git pull and bin/composer.phar install --no-dev
step.
A in a first visit of the domain, instead of the system requirement check list a simple list of the files and folder of the "html" directory showed up. Than the server "broke down" and both domains, the new one and this one here gave just black pages, stating that the sites weren't reachable at all.
The console printed about the apache server the following:
apache error messages
root@VPShosting:/var/www# 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@VPShosting:/var/www# systemctl status apache2
× apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2025-02-26 14:20:25 UTC; 1min 18s ago
Docs: httpd.apache.org/docs/2.4/
Process: 38181 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
CPU: 20ms
Feb 26 14:20:25 tupambae.org systemd[1]: Starting The Apache HTTP Server...
Feb 26 14:20:25 tupambae.org apachectl[38184]: apache2: Syntax error on line 225 of /etc/apache2/apache2.conf: Syntax error on line 20 of /etc/apache2/sites-e>
Feb 26 14:20:25 tupambae.org apachectl[38181]: Action 'start' failed.
Feb 26 14:20:25 tupambae.org apachectl[38181]: The Apache error log may have more information.
Feb 26 14:20:25 tupambae.org systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Feb 26 14:20:25 tupambae.org systemd[1]: apache2.service: Failed with result 'exit-code'.
Feb 26 14:20:25 tupambae.org systemd[1]: Failed to start The Apache HTTP Server.
To get this instance here running again the new domain was deactivated by:
sudo a2dissite newdomain.com
and restarting apache by:
systemctl restart apache2
Any idea what could be the problem or where to search for resolving this? 6.3.2025 04:06New note by admin
https://tupambae.org/display/0ac...New note by admin
https://tupambae.org/display/0ac...!Friendica Support
Problems with new friendica instance.
Actually the following post by @TupambAdminCom [2024.12] to the helpers forum doesn't show up in the helpers stream if I see this right but is available on the forum server:
Error message, not sure from wich instance right now. Probably from the originating instance as in this case the helpers page was addressed with {!}
Conversation Not Found
Unfortunately, the requested conversation isn't available to you.
Possible reasons include:
The top-level post isn't visible.
The top-level post was deleted.
This node has blocked the top-level author or the author of the shared post.
You have ignored or blocked the top-level author or the author of the shared post.
You have ignored the top-level author's server or the shared post author's server.
tupambae.com/display/ccf09959-…
forum.friendi.ca/display/ccf09…
6.3.2025 04:06New note by admin
https://tupambae.org/display/0ac...New note by admin
https://tupambae.org/display/0ac...Once the subdomain appears in your browser as a http site, you can proceed to create a let's encrypt SSL certificate for the domain.
As this is just creating a new certificate on an already existing let's encrypt registered certbot environment, this is quite fast and straight forward. The cert builds on the information created by the previous step of creating a sub.domain.org.conf file in /etc/apache2/sites-available/ and will create a new .conf file named:
sub.domain.org-le-ssl.conf
rootname@VPShosting:~$ sudo certbot --apache
print of the certbot routine
root@VPShosting:~# sudo certbot --apache
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Which names would you like to activate HTTPS for?
We recommend selecting either all domains, or all domains in a VirtualHost/server block.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: domain.org
2: sub.domain.org
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 2
Requesting a certificate for sub.domain.org
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/sub.domain.org/fullchain.pem
Key is saved at: /etc/letsencrypt/live/sub.domain.org/privkey.pem
This certificate expires on 2025-05-25.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.
Deploying certificate
Successfully deployed certificate for sub.domain.org to /etc/apache2/sites-available/sub.domain.org-le-ssl.conf
Congratulations! You have successfully enabled HTTPS on sub.domain.org
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
* Donating to ISRG / Let's Encrypt: letsencrypt.org/donate
* Donating to EFF: eff.org/donate-le
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Successfully deployed certificate for sub.domain.org to /etc/apache2/sites-available/sub.domain.org-le-ssl.conf
Congratulations! You have successfully enabled HTTPS on
sub.domain.org
26.2.2025 03:23New note by admin
https://tupambae.org/display/0ac...New note by admin
https://tupambae.org/display/0ac...Create a [sub]domain
Create the inicial folder to host the content:
rootname@VPShosting:~# mkdir /var/www/subdomainorg/
Create a index.html file to test the new subdomain:
rootname@VPShosting:~# nano /var/www/html/subdomainorg/index.html
content of index.html
<html>
<title>subdomainorg</title>
<h1>Welcome to sub.domain.org Website</h1>
<p>This is the first test subdomain site hosted with name-based virtual hosting</p>
</html>
Create ownership for the user www-data of the files and folders in /subdomainorg/:
rootname@VPShosting:~# chown -R www-data:www-data /var/www/subdomainorg/
Change ownership of the folder /subdomainorg/ itself to the user root:
rootname@VPShosting:~# chown root:root /var/www/subdomainorg
Create a domain registry file on the VPS server in /etc/apache2/sites-available/ for the subdomain:
rootname@VPShosting:~# nano /etc/apache2/sites-available/sub.domain.org.conf
content of sub.domain.org.conf
<VirtualHost *:80>
ServerAdmin admin@sub.domain.org
ServerName sub.domain.org
DocumentRoot /var/www/subdomainorg
DirectoryIndex index.html
ErrorLog ${APACHE_LOG_DIR}/subdomainorg_error.log
CustomLog ${APACHE_LOG_DIR}/subdomainorg_access.log combined
</VirtualHost>
Register the new [sub]domain on the VPS server and restart the Apache webserver to apply the configuration changes:
rootname@VPShosting:~# a2ensite sub.domain.org
rootname@VPShosting:~# systemctl restart apache2
Register the subdomain IP with the domain registry provider using the VPS IP.
Depending on specific settings of the IP update routine, these changes can take up to a day to take effect and your subdomain index.html file should show up as expected.
26.2.2025 03:10New note by admin
https://tupambae.org/display/0ac...