How to get phpinfo to display info

Hi

I’m using Nextcloud version 22.2.3. I tried creating a phpinfo.php file which I placed in the root folder of the Nextcloud installation. When I try to access it from my browser - it does not show the information from the phpinfo file - instead I’m just seeing the normal Nextcloud.

I would like the information from the phpinfo file. Any idea how I should set it up?

The PHP version can be checked in the Settings/System overview. Do you need more?

I would like to see the settings/modules/extensions. It would be nice if it was possible to see within Nextcloud - or an explanation how I could let it be shown temporarily without Nextcloud “hijacking” the URL.

Nobody having any idea how to do it?

Where you created the file (ex info.php) you can just do php info.php on the console
info.php should consist of

INFO.PHP
<?php
phpinfo()
?>

this equals the output of

php -i

I would like to have it in the root folder of the my Nextcloud installation - so I get the information that applies to the website (I’m not that used to Linux/Apache). I will of course remove it when I do not use it.

The problem is that when i enter www.mysite.com/phpinfo.php I’m redirected to www.mysite.com/apps/files/ - I guess that there might be some mod_rewrite rules? Any idea how I bypass them for just this file?

I do get the info when I add the file in the main installation directory.
Obviously it’s a setting for you.

You can still get the values from command line

php -c /etc/php/8.1/apache2/php.ini -c /var/www/nextcloud/.user.ini -i

Notice the PHP Version 8.1 8.0 or 7.x and the /var/www/nextcloud as installation directory.

I found the solution. In the .htaccess file in the root of the site i change i added the filename in the below part (I have marked it with ** in front of phpinfo and ** after

#### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####

ErrorDocument 403 /
ErrorDocument 404 /
<IfModule mod_rewrite.c>
  Options -MultiViews
  RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]
  RewriteRule ^core/preview.png$ index.php [PT,E=PATH_INFO:$1]
  RewriteCond %{REQUEST_FILENAME} !\.(css|js|svg|gif|png|html|ttf|woff2?|ico|jpg|jpeg|map|webm|mp4|mp3|ogg|wav|wasm|tflite)$
  RewriteCond %{REQUEST_FILENAME} !/core/ajax/update\.php
  RewriteCond %{REQUEST_FILENAME} !/core/img/(favicon\.ico|manifest\.json)$
  RewriteCond %{REQUEST_FILENAME} !/(cron|public|remote|status|**phpinfo**)\.php
  RewriteCond %{REQUEST_FILENAME} !/ocs/v(1|2)\.php
  RewriteCond %{REQUEST_FILENAME} !/robots\.txt
  RewriteCond %{REQUEST_FILENAME} !/(ocm-provider|ocs-provider|updater)/
  RewriteCond %{REQUEST_URI} !^/\.well-known/(acme-challenge|pki-validation)/.*
  RewriteCond %{REQUEST_FILENAME} !/richdocumentscode(_arm64)?/proxy.php$
  RewriteRule . index.php [PT,E=PATH_INFO:$1]
  RewriteBase /
  <IfModule mod_env.c>
    SetEnv front_controller_active true
    <IfModule mod_dir.c>
      DirectorySlash off
    </IfModule>
  </IfModule>
</IfModule>