Hi,
iāve installed Nextcloud after the guide in the ArchLinux Wiki.
Calling the website results in an Internal server error.
Itās hard to troubleshoot or search errors online, if I cannot get any output in the error log.
I tried to enable error_logging and display_errors in all php.ini (nextclouds, php-fpm) files and also activated debug mode in nextcloud config.php. No luck.
Iām running out of options and donāt know what to do next.
One thing I tried to check if the php-fpm is working was by adding a print(ātestā); and Exit; to the index.php file of nextcloud before the nextcloud code gets executed.
Apache/PHP returned successfully and even wrote to the log:
[Mon Apr 10 23:41:55.209261 2023] [proxy_fcgi:error] [pid 167285:tid 139919984924352] [client xxx.xxx.xxx.xx:63747] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Typed static property OC::$server must not be accessed before initialization in /usr/share/webapps/nextcloud/index.php:73\nStack trace:\n#0 {main}\n thrown in /usr/share/webapps/nextcloud/index.php on line 73'
Things I suspected and checked:
- Permission problem? User http needs access to files/folders where user nextcloud has the only perms
- PHP and PHP-LEGACY are both installed. Are extensions missing? Doesnāt look so.
- Nextcloud is having a problem with just an IP address (no hostname)? Or the Apache vhost config for it?
More details:
Setup is Apache + PHP (legacy) + FPM
/var/log/nextcloud/nextcloud.log
ā empty ā
Apache vhost:
<VirtualHost 123.4.567.89:80>
DocumentRoot "/srv/http/default"
ErrorLog "/var/log/httpd/defaultfolder-error_log"
CustomLog "/var/log/httpd/defaultfolder-access_log" common
#nextcloud config
Alias /nextcloud /usr/share/webapps/nextcloud
<Directory /usr/share/webapps/nextcloud>
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews
DirectoryIndex index.php index.html
<IfModule mod_dav.c>
Dav off
</IfModule>
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php-fpm-legacy/nextcloud.sock|fcgi://nextcloud/"
</FilesMatch>
</Directory>
</VirtualHost>
/etc/webapps/nextcloud/config/config.php
<?php
$CONFIG = array (
'datadirectory' => '/var/lib/nextcloud/data',
'log_type' => 'errorlog',
'debug' => false,
'logfile' => '/var/log/nextcloud/nextcloud.log',
'apps_paths' =>
array (
0 =>
array (
'path' => '/usr/share/webapps/nextcloud/apps',
'url' => '/apps',
'writable' => false,
),
1 =>
array (
'path' => '/var/lib/nextcloud/apps',
'url' => '/wapps',
'writable' => true,
),
),
'passwordsalt' => 'xxx',
'secret' => 'xxx',
'trusted_domains' =>
array (
0 => 'localhost',
1 => '123.4.567.89'
),
'dbtype' => 'pgsql',
'version' => '26.0.0.11',
'overwrite.cli.url' => 'http://123.4.567.89',
'htaccess.RewriteBase' => '/nextcloud',
'dbname' => 'nextcloud',
'dbhost' => '/run/postgresql:9090',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => 'nextcloud',
'dbpassword' => 'xxx',
'installed' => true,
'instanceid' => 'xxx',
'memcache.local' => '\OC\Memcache\APCu',
'memcache.distributed' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => [
'host' => '/run/redis/redis.sock',
'port' => 6345,
'dbindex' => 0,
'password' => '',
'timeout' => 1.5,
],
);
/var/log/php-fpm-legacy/access/nextlcoud.log (always the same error)
2023-04-10T23:03:29+0200 -: "GET /nextcloud/index.php" 500 //usr/share/webapps/nextcloud/index.php 12.268 2048 0.00%
I also checked other logs like redis, postgresql, but no errors detectable.
Help is highly appreciated. Thank you.