Every added line in config.php creates an 'Internal Server Error'. Where is the cause?

The Basics

  • NextcloudPi

  • Operating system and version :
    • `Proxmox Debian 12

Summary of the issue you are facing:

  • I wanted to enable video previews, so i tried to edit the config.php file. Every entry I add, causes an Internal Server Error’ through the Browser.
  • I also tried to create a seperate preview.config.php file which caused the same problem.
  • Removing every entry solves the problem and Nextcloud is accessible through the browser again.

Steps to replicate it (hint: details matter!):

  1. Being Logged in as root@nextcloudpi on Proxmox Webinterface
  2. cd …
  3. sudo nano var/www/nextcloud/config/config.php
  4. Full config.php document appears with various informations
  5. Adding (for easy summary here) a single line like: ‘preview_ffmpeg_path’ => ‘/usr/bin/ffmpeg’ (in between or at the end of the lines doesn’t change the problem)
  6. STRG+X
  7. Y
  8. Reboot
  9. Log-in through proxmox works
  10. But not over the Browser to the nextcloud interface

I am using this tutorial which was recommended here:
https://www.allerstorfer.at/nextcloud-install-preview-generator/

trying :

sudo -u www-data php /var/www/nextcloud/occ preview:generate-all -vvv
gives errors like

ParseError: syntax error, unexpected single-quoted string “enable_previews”, expecting “)” in /var/www/nextcloud/config/config.php:55

Log entries

Sorry. I am a newbie. Don’t know which logs are needed

My planed entries are:

‘preview_ffmpeg_path’ => ‘/usr/bin/ffmpeg’
‘enable_previews’ => true,
‘enabledPreviewProviders’ =>
array (
0 => ‘OC\Preview\TXT’,
1 => ‘OC\Preview\MarkDown’,
2 => ‘OC\Preview\OpenDocument’,
3 => ‘OC\Preview\PDF’,
4 => ‘OC\Preview\MSOffice2003’,
5 => ‘OC\Preview\MSOfficeDoc’,
6 => ‘OC\Preview\Image’,
7 => ‘OC\Preview\Photoshop’,
8 => ‘OC\Preview\TIFF’,
9 => ‘OC\Preview\SVG’,
10 => ‘OC\Preview\Font’,
11 => ‘OC\Preview\MP3’,
12 => ‘OC\Preview\Movie’,
13 => ‘OC\Preview\MKV’,
14 => ‘OC\Preview\MP4’,
15 => ‘OC\Preview\AVI’,
),
);

If you modify a configuration you need to make sure that you are using the right PHP syntax. In the first line e.g. a trailing comma is missing :wink:

3 Likes

THANK YOU j-ed.

2 hours of work and searching. asked even duckduckgo chatgpt for errors :slight_smile:

1 Like

Natural intelligence still is better, than artificial intelligence :wink:

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.