I have a working Ubuntu 18.04 server with MySQL 5.7.25, PHP 7.2.17 and Apache 2.4.29. Virtual servers are properly configured and I have a number of working PHP sites. I went through the NC docs to confirm that I’ve installed and enabled all of the required PHP and Apache modules.
I’ve tried installing both NC15 and the latest NC16.0.0 (just released) multiple times now, and I always experience the same problem: the site pages display as raw HTML and aren’t rendered.
(I’ve pasted that in exactly as it appears – should the oc_webroot have a value at this point?)
I created an info.php file for that folder and it displays the same broken way – just visible HTML for what the usual php info table page looks like.
When I temporarily disable .htaccess in the root folder, my info.php file DOES correctly display the standard php info page. But the index.php still displays just as raw HTML. So there must be something in the .htaccess settings that’s conflicting with something in my Apache config, right?
The SITEROOT/data/nextcloud.log file is empty. I checked the Apache log (and even kicked up error reporting to “debug”) and it’s just a list of successful SSL requests with no errors.
Any advice? I’ve never seen something like this and I’m not sure where to look next.
Thanks in advance!
So this definitely is a configuration issue in my opinion. The PHP interpreter is not called correctly or something like that.
You should post a few of your configs so we can check.
- config.php (from nextcloud install dir; REMOVE sensistive information before posting!)
- apache site config
- .htaccess (which you think causes issues)
Due to the fact that PHP is used as a command line tool (CLI) and also as a web server component (WEB) different results are possible. You wrote that the installation succeeded on the command line so the web server configuration most likely need to be improved.
Are you sure that PHP has correctly installed on your server? Usually a php-fpm package need to be installed as described here.
Once this has been confirmed you should be able to check the PHP server configuration by creating e.g. a file info.php, which contains this command
<?php phpinfo() ?>, and which displays detailed PHP information when called.
As always, I appreciate the suggestions. But on a lark, I tested a couple of other things that I think have ruled out any sort of system-wide PHP problem:
- My NextCloud instance DOES work perfectly in Firefox; it only displays the broken raw-HTML version in Chrome. So I don’t think it’s a PHP problem.
- I downloaded and tested OwnCloud on a separate virtual server and it behaved the exact same way as NextCloud: displays fine in Firefox, displays broken raw-HTML in Chrome.
- ALL of the other PHP sites on this server work perfectly and they always have since I built this server last year (Drupal 7 and 8, Wordpress 5, GeoNode, custom PHP apps), so I know the general LAMP stack is functional.
(I know it is possible that our default apache-site.conf file that we use to create our virtual servers has a conflict with a PHP setting in NC’s .htaccess but I have no idea what that would be! Any ideas?)
So at this point I’m wondering if it’s some sort of HSTS problem or something, and that’s why it won’t show up in Chrome. I confirmed the trusted domain part of the config file is set up with my domain. I’ve confirmed I’m using the latest Chrome on ALL 3 of my affected devices, and I’ve confirmed that my LetsEncrypt cert is green and valid both manually and with an automated scanner. Definitely a browser problem but what?!
Thanks again for any suggestions!
Now that would be a very nice information to have right at the beginning, in the initial post
Knowing that now, I totally agree, that it isn’t a general issue with PHP setup on the server.
Now I think it is a Chrome issue
(I wonder anyway why one is taking privacy serious enough to choose NC over Google drive, but still use Chrome on the other hand )
Chrome has a browser console as well, right? Are there any error messages which might help to find out why Chrome blocks dynamic content?
Do you use Addons which may block Java-Script or something like that? Could you run Chrome in some kind of “safe mode” without any plugins?
Oh and the .htaccess part is interesting as well. Could you post your .htaccess from the root directory?