Fresh Install Errors

Got this error with a fresh install of nextcloud in a truenas server.
PHP does not seem to be setup properly to query system environment variables. The test with getenv(“PATH”) only returns an empty response. Please check the installation documentation :arrow_upper_right: for PHP configuration notes and the PHP configuration of your server, especially when using php-fpm.
Some app directories are owned by a different user than the web server one. This may be the case if apps have been installed manually. Check the permissions of the following app directories:
/usr/local/www/nextcloud/apps-pkg/accessibility
/usr/local/www/nextcloud/apps-pkg/activity
/usr/local/www/nextcloud/apps-pkg/admin_audit
/usr/local/www/nextcloud/apps-pkg/cloud_federation_api
/usr/local/www/nextcloud/apps-pkg/comments
/usr/local/www/nextcloud/apps-pkg/contactsinteraction
/usr/local/www/nextcloud/apps-pkg/dashboard
/usr/local/www/nextcloud/apps-pkg/dav
/usr/local/www/nextcloud/apps-pkg/encryption
/usr/local/www/nextcloud/apps-pkg/federatedfilesharing
/usr/local/www/nextcloud/apps-pkg/federation
/usr/local/www/nextcloud/apps-pkg/files
/usr/local/www/nextcloud/apps-pkg/files_external
/usr/local/www/nextcloud/apps-pkg/files_pdfviewer
/usr/local/www/nextcloud/apps-pkg/files_rightclick
/usr/local/www/nextcloud/apps-pkg/files_sharing
/usr/local/www/nextcloud/apps-pkg/files_trashbin
/usr/local/www/nextcloud/apps-pkg/files_versions
/usr/local/www/nextcloud/apps-pkg/files_videoplayer
/usr/local/www/nextcloud/apps-pkg/firstrunwizard
/usr/local/www/nextcloud/apps-pkg/logreader
/usr/local/www/nextcloud/apps-pkg/lookup_server_connector
/usr/local/www/nextcloud/apps-pkg/nextcloud_announcements
/usr/local/www/nextcloud/apps-pkg/notifications
/usr/local/www/nextcloud/apps-pkg/oauth2
/usr/local/www/nextcloud/apps-pkg/password_policy
/usr/local/www/nextcloud/apps-pkg/photos
/usr/local/www/nextcloud/apps-pkg/privacy
/usr/local/www/nextcloud/apps-pkg/provisioning_api
/usr/local/www/nextcloud/apps-pkg/recommendations
/usr/local/www/nextcloud/apps-pkg/serverinfo
/usr/local/www/nextcloud/apps-pkg/settings
/usr/local/www/nextcloud/apps-pkg/sharebymail
/usr/local/www/nextcloud/apps-pkg/support
/usr/local/www/nextcloud/apps-pkg/survey_client
/usr/local/www/nextcloud/apps-pkg/systemtags
/usr/local/www/nextcloud/apps-pkg/text
/usr/local/www/nextcloud/apps-pkg/theming
/usr/local/www/nextcloud/apps-pkg/twofactor_backupcodes
/usr/local/www/nextcloud/apps-pkg/updatenotification
/usr/local/www/nextcloud/apps-pkg/user_ldap
/usr/local/www/nextcloud/apps-pkg/user_status
/usr/local/www/nextcloud/apps-pkg/viewer
/usr/local/www/nextcloud/apps-pkg/weather_status
/usr/local/www/nextcloud/apps-pkg/workflowengine

saw other post but got lost identifying the group the sample said should do this: chown -R “user:group” /usr/local/www/nextcloud/apps-pkg

part of the problem was fixed looking in the path /usr/local/www/nextcloud/apps for the user and group with ls -l and running:
chown -R “www:www” /usr/local/www/nextcloud/apps-pkg

now working in the other problem: PHP does not seem to be setup properly to query system environment variables. The test with getenv(“PATH”) only returns an empty response. Please check the installation documentation :arrow_upper_right: for PHP configuration notes and the PHP configuration of your server, especially when using php-fpm.

had commented out:
;env[HOSTNAME] = $HOSTNAME
;env[PATH] = /usr/local/bin:/usr/bin:/bin
;env[TMP] = /tmp
;env[TMPDIR] = /tmp
;env[TEMP] = /tmp

it did not work and also as the manual says:
clear_env = no

either

ok i give up for some reason things go back again and even nano gets uninstall by it self … any idea ?