Nextcloud version (eg, 18.0.2): 19.0.0
Operating system and version (eg, Ubuntu 20.04): Ubuntu 18.04.3
Apache or nginx version (eg, Apache 2.4.25): 2.4.43
PHP version (eg, 7.1): currently still 7.2, want to go to 7.4
The issue you are facing:
I want to have my nextcloud install use php7.4 instead of 7.2. Have searched a lot in the forum as well as other php upgrade related sites, but am not getting it to work.
I have installed php7.4 including the modules which are currently in the php7.2 installation (there are 3 more modules in the 7.4 installation. I canât install the wddx module for 7.4 as this does not seem to exist.
php7.2 -m
php7.4 -m
[PHP Modules]
[PHP Modules]
bcmath
bcmath
bz2
bz2
calendar
calendar
Core
Core
ctype
ctype
curl
curl
date
date
dom
dom
exif
exif
FFI
fileinfo
fileinfo
filter
filter
ftp
ftp
gd
gd
gettext
gettext
gmp
gmp
hash
hash
iconv
iconv
imap
imap
intl
intl
json
json
ldap
ldap
libsmbclient
libsmbclient
libxml
libxml
mbstring
mbstring
mysqli
mysqlnd
openssl
openssl
pcntl
pcntl
pcre
pcre
PDO
PDO
pdo_mysql
pdo_pgsql
pdo_pgsql
pgsql
pgsql
Phar
Phar
posix
posix
readline
readline
Reflection
Reflection
session
session
shmop
shmop
SimpleXML
SimpleXML
smbclient
smbclient
soap
soap
sockets
sockets
sodium
sodium
SPL
SPL
standard
standard
sysvmsg
sysvmsg
sysvsem
sysvsem
sysvshm
sysvshm
tokenizer
tokenizer
wddx
xml
xml
xmlreader
xmlreader
xmlwriter
xmlwriter
xsl
xsl
Zend OPcache
Zend OPcache
zip
zip
zlib
zlib
[Zend Modules]
[Zend Modules]
Zend OPcache
Zend OPcache
I set the php version to php4 (alternative version).
php --version
I copied the file /etc/php/7.2/fpm/pool.d/nextcloud.conf to /etc/php/7.4/fpm/pool.d and modified the Handler.
The php7.4-fpm service is running (as well as the php7.2-fpm service).
Afterwards restarted Apache. The only thing that I get is âInternal Server Errorâ and canât find a logfile with a meaningful error message which might point me in a possible resolution.
Would appreciate a helpful hint a lot. Iâm stuck
You copied the nextcloud.conf to /etc/php/7.4/fpm/pool.d. Did you modify it after copying? There are references to the php version in it. You also have to restart the php7.4-fpm service.
I think Nextcloud 19 is the last version you can use with the php version. You have a few months to dist-upgrade to Ubuntu 20.04 LTS or only change the php-version. You also can use Nextcloud 19 after release of 20 and 21.
Which lead me to think I could get some more information from the original index.php file. I did find âmyâ error message in there (at the bottom):
require_once __DIR__ . '/lib/versioncheck.php';
try {
require_once __DIR__ . '/lib/base.php';
OC::handleRequest();
} catch (\OC\ServiceUnavailableException $ex) {
\OC::$server->getLogger()->logException($ex, ['app' => 'index']);
//show the user a detailed error page
OC_Template::printExceptionErrorPage($ex, 503);
} catch (\OC\HintException $ex) {
try {
OC_Template::printErrorPage($ex->getMessage(), $ex->getHint(), 503);
} catch (Exception $ex2) {
try {
\OC::$server->getLogger()->logException($ex, ['app' => 'index']);
\OC::$server->getLogger()->logException($ex2, ['app' => 'index']);
} catch (Throwable $e) {
// no way to log it properly - but to avoid a white page of death we try harder and ignore this one here
}
//show the user a detailed error page
OC_Template::printExceptionErrorPage($ex, 500);
}
} catch (\OC\User\LoginException $ex) {
OC_Template::printErrorPage($ex->getMessage(), $ex->getMessage(), 403);
} catch (Exception $ex) {
\OC::$server->getLogger()->logException($ex, ['app' => 'index']);
//show the user a detailed error page
OC_Template::printExceptionErrorPage($ex, 500);
} catch (Error $ex) {
try {
\OC::$server->getLogger()->logException($ex, ['app' => 'index']);
} catch (Error $e) {
http_response_code(500);
header('Content-Type: text/plain; charset=utf-8');
print("Internal Server Error\n\n");
print("The server encountered an internal error and was unable to complete your request.\n");
print("Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.\n");
print("More details can be found in the webserver log.\n");
throw $ex;
}
OC_Template::printExceptionErrorPage($ex, 500);
}
Unfortunately my PHP knowledge is very limited. I do understand it checks a few things and throws an exception when a check fails. What I canât read out of those lines, is at what kind of check it stumbles to give me the error message I see when I configure 7.4 for the site.
I am now able to logon and the system page shows me PHP 7.4.8!
Ofcourse the overview page is now complaining now caching is activated, which I will not have to look at. But at least I was able to narrow down, where the issue is.
With the problem area known, the solution was quite easy. I had to install two additional php packages (I compared the packages installed for 7.2 and 7.4 and these two did not popup for 7.2):
apt install php-redis
apt install php-apcu
After installation and restart von apache, all was fine. Ready for NC 20.
Sorry i use Debian GNU/Linux. But i never set the php-configuration in then apache2-configuration-file. But i always uses the standard-release with the standard-php-installation.
If you have dist-upgraded your Ubuntu-installation you can install sudo apt-get install apt-show-versions
and test for old not-focal packages.
apt-show-versions |grep -v focal
(not tested, perhaps you can delete them)
There could be old php 7.2 - packages.
Perhaps with dist-upgrade to Ubuntu 22.04 LTS you can direct delete old packages.