HTTP 500 Error after 'systemctl restart apache2'

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 21.0.0
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04.2 LTS
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.41
PHP version (eg, 7.4): 7.4

The issue you are facing:

I cannot access my nextcloud instance at all. I get a HTTP 500 error. I am able to access the standard Apache page so I believe Apache is running fine.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Install Nextcloud in brand new VM following this video: (2) Nextcloud 17 on Debian 10 (Installation & First Look) - YouTube
  2. I was trying to fix the errors in Settings >Overview, specifically the ones regarding low memory
  3. Modify /etc/php/7/4/apache2/php.ini file to have 1024MB of memory instead of 128MB
  4. Checked nextcloud and refershed but the error was still there.
  5. ran systemctl restart apache2 command in SSH.
  6. Nextcloud now shows HTTP 500 error. However the base Apache page still loads under localhost.

The output of your Nextcloud log in Admin > Logging:

#cannot get output as I cannot access nextcloud

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

$CONFIG = array (
  'instanceid' => 'instanceidhere',
  'passwordsalt' => 'passwordsalthere',
  'secret' => 'secrethere',
  'trusted_domains' =>
  array (
    0 => '',
  'datadirectory' => '/home/tom/NextCloud',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => '',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'passwordhere',
  'installed' => true,

The output of your Apache/nginx/system log in /var/log/____:

#I couldn't find System Log in that directory but I found the error.log file and it has dozens and dozens of error lines exactly like the following so I wont post them all. 

[Tue Mar 16 22:05:54.949474 2021] [php7:error] [pid 474756] [client] PHP Fatal error:  Allowed memory size of 2097152 bytes exhausted (tried to allocate 4096 bytes) in /var/www/nextcloud/3rdparty/composer/autoload_static.php on line 3441

Any help at all is appreciated, if there’s something I need to read up on please point me in the right direction. I am very new to all of this. thanks.,

Solved this. turns out my inexperience shows. I used “MB” instead of “M” in the php.ini file to define the memory allocated.