Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
(htaccess) Permit user-provided phpinfo.php access
Even though some PHP info is exposed in NC under Admin->System, accessing phpinfo() via the web server is still routinely needed to troubleshoot an installation. One common case would be if the NC installation is completely broken - in which case Admin->System would also be inaccessible to the admin. 

While the admin will still needs to provide their own phpinfo.php file, this enables it to be accessible as expected (and as I believe was once possible several NC versions ago IIRC anyhow).

(Thanks to PSN for the idea: https://help.nextcloud.com/t/how-to-get-phpinfo-to-display-info/133180/8)

Signed-off-by: Josh Richards <[email protected]>
  • Loading branch information
joshtrichards authored May 9, 2023
commit 1cde00763b49d5cc98a7546c3204e782e6de6425
2 changes: 1 addition & 1 deletion lib/private/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ public static function updateHtaccess() {
$content .= "\n RewriteCond %{REQUEST_FILENAME} !\\.(css|js|svg|gif|png|html|ttf|woff2?|ico|jpg|jpeg|map|webm|mp4|mp3|ogg|wav|wasm|tflite)$";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/core/ajax/update\\.php";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/core/img/(favicon\\.ico|manifest\\.json)$";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/(cron|public|remote|status)\\.php";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/(cron|public|remote|status|phpinfo)\\.php";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/ocs/v(1|2)\\.php";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/robots\\.txt";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/(ocm-provider|ocs-provider|updater)/";
Expand Down