Hi everybody,
I have a problem with php setup in Nextcloud. I’m using Nginx (before Apache2) because it uses less resources.
But i got an error message that says: 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 for php configuration notes and the php configuration of your server, especially when using php-fpm.
How do i fix this?
Sorry for my English it is not my native language.
thank you in advance.
Hi grouchysysadmin,
I also forgot to say that my server is a Raspberry Pi. The OS is Raspbian.
Thanks for your reply. I don’t know alot about php and i am stuck at this point in the manual:
Usually, you will find some or all of the environment variables already in the file, but commented out like this:
;env[HOSTNAME] = $HOSTNAME
;env[PATH] = /usr/local/bin:/usr/bin:/bin
;env[TMP] = /tmp
;env[TMPDIR] = /tmp
;env[TEMP] = /tmp
The manual says that i have to uncomment the variables. I looked on Google but it says to comment out you need to remove the // or /* infront of the code. Does this mean it is already commented out? If not how do i comment it out? Do i also need to change the ‘HOSTNAME’ ?
This is the www.conf file from my server:
; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
; the current environment.
; Default Value: clean env
;env[HOSTNAME] = $HOSTNAME
;env[PATH] = /usr/local/bin:/usr/bin:/bin
;env[TMP] = /tmp
;env[TMPDIR] = /tmp
;env[TEMP] = /tmp
What do i need to change in order to get rid of the message and errors in the logfiles like this:
Logfile error:
Error PHP Uncaught Error: Access to undeclared static property: OC\Files\Filesystem::$normalizedPathCache in /var/www/nextcloud/lib/private/Files/Filesystem.php:806 Stack trace: #0 /var/www/nextcloud/lib/private/Files/View.php(2018): OC\Files\Filesystem::normalizePath(’/Vincent/files/…’) #1 /var/www/nextcloud/lib/private/Files/View.php(1156): OC\Files\View->unlockFile(’/Sync/Moto x/Ca…’, 1) #2 [internal function]: OC\Files\View->OC\Files{closure}() #3 /var/www/nextcloud/3rdparty/icewind/streams/src/CallbackWrapper.php(109): call_user_func(Object(Closure)) #4 [internal function]: Icewind\Streams\CallbackWrapper->stream_close() #5 {main} thrown at /var/www/nextcloud/lib/private/Files/Filesystem.php#806
Thank you in advance.
Hi grouchysysadmin,
This solved my problem. Thank you very much for your help! And happy New Year.