-1

I use my webserver for e.g. nextcloud.

Until now I could enter the cloud via https://mydomain/nextcloud. But for some reason the nextcloud page is displayed as plain text!?

It works if I enter the index page https://mydomain/nextcloud/index.php.


Because I had no time to solve this problem yet, my workaround was:

yum reinstall php
systemctl restart httpd

But since today that does not work anymore..!?


Thinks like this did not help.

1 Answers1

1

Do you have this at the appropriate place?

<IfModule dir_module>
    DirectoryIndex index.php index.shtml index.sht index.html index.htm
</IfModule>

Is the module loaded?

If the URI points to an directory, Apache will try to append an index file.

  1. It will walk the list in DirectoryIndex and use the first file that exists.
  2. If not Apache will show the content of the folder (if allowed) or send an HTTP status code 403.

DirectoryIndex can be set globaly in httpd.conf and additionally in the <VirtualHost ... > container for the individual virtual host.

Does your shown "plain text" contain PHP script code?

As your answer is "Yes":
Your problem is that PHP is not interpreting the code.

Is PHP installed? – What's the result of this command?

php -v

As in the past php has worked I would suggest also to reinstall php:

yum reinstall php php-cli

.... plus possibly some extras that nextcloud might require.

dodrg
  • 1,142
  • 2
  • 18
  • I had only the `DirectoryIndex index.php` part. After replacing it with your posted `IfModule dir_module ...` I was able to access my roundcube page (wich was previously broken, too) but the nextcloud folder is still inaccessible.. – Meisterzunge Mar 26 '23 at 18:58
  • At _Does your shown "plain text" contain PHP script code?_: Yes it does! – Meisterzunge Mar 26 '23 at 19:01
  • Sure, php is installed. The `php -v` output is `PHP 7.4.33 (cli)` – Meisterzunge Mar 26 '23 at 19:38
  • Please note: nexcloud is ready for PHP 8 and all versions below 8.0 are not supported anymore by php.org — but this is not the problem of your current issue. – dodrg Mar 26 '23 at 19:50
  • lol, that worked! But: I had already tried `yum reinstall php*` (which included the cli). Why did that not work?! Thanks anyway :) – Meisterzunge Mar 26 '23 at 19:51
  • Na dann, viel Glück mit dem Rest :-) – dodrg Mar 26 '23 at 19:54