clonos / control-pane

ClonOS WEB control panel (CBSD WEB UI)
https://clonos.tekroutine.com
128 stars 31 forks source link

php error #5

Closed danniculescu closed 6 years ago

danniculescu commented 6 years ago

Hi Oleg, I just installed ClonOS on a 12.0-CURRENT and I get the following error in /var/log/nginx/cbsdweb.err

2017/10/12 02:13:52 [error] 56976#100981: 65 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined offset: 0 in /usr/local/www/clonos/php/clonos.php on line 127 PHP message: PHP Notice: Undefined offset: 0 in /usr/local/www/clonos/php/menu.php on line 47" while reading response header from upstream, client: 192.168.1.108, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.sock:", host: "192.168.1.108" 2017/10/12 02:13:53 [error] 56976#100981: 65 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function query() on null in /usr/local/www/clonos/php/db.php:139 Stack trace:

0 /usr/local/www/clonos/public/pages/overview/a.json.php(17): Db->select('select nodename...')

1 /usr/local/www/clonos/php/clonos.php(160): include('/usr/local/www/...')

2 /usr/local/www/clonos/public/json.php(12): ClonOS->__construct('/usr/local/www/...')

3 {main}

thrown in /usr/local/www/clonos/php/db.php on line 139" while reading response header from upstream, client: 192.168.1.108, server: , request: "POST /json.php HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.sock:", host: "192.168.1.108", referrer: "http://192.168.1.108/overview/"

If I navigate to settings I get a pop-up with the message:

JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 3 of the JSON data

olevole commented 6 years ago

notes for myself: most likely caused by the absence of additional CBSD modules for the ClonOS database

olevole commented 6 years ago

The code has been updated and the instruction has been supplemented (with instructions for initializing the database): https://clonos.tekroutine.com/installation_on_freebsd.html

. I assume that the problem is fixed. Thanks for issue!

windymelt commented 5 years ago

Same problem on FreeBSD-12.0 RELEASE-p3 here:

[17-May-2019 01:04:28] WARNING: [pool www] child 70497 said into stderr: "NOTICE: PHP message: PHP Fatal error:  Uncaught Error: Call to a member function query() on null in /usr/local/www/clonos/php/db.php:147"
[17-May-2019 01:04:28] WARNING: [pool www] child 70497 said into stderr: "Stack trace:"
[17-May-2019 01:04:28] WARNING: [pool www] child 70497 said into stderr: "#0 /usr/local/www/clonos/public/pages/sources/a.json.php(5): Db->select('select nodename...')"
[17-May-2019 01:04:28] WARNING: [pool www] child 70497 said into stderr: "#1 /usr/local/www/clonos/php/clonos.php(199): include('/usr/local/www/...')"
[17-May-2019 01:04:28] WARNING: [pool www] child 70497 said into stderr: "#2 /usr/local/www/clonos/public/json.php(12): ClonOS->__construct('/usr/local/www/...')"
[17-May-2019 01:04:28] WARNING: [pool www] child 70497 said into stderr: "#3 {main}"
[17-May-2019 01:04:28] WARNING: [pool www] child 70497 said into stderr: "  thrown in /usr/local/www/clonos/php/db.php on line 147"

I initialized database along https://clonos.tekroutine.com/installation_on_freebsd.html , but it doesn't work.

I found getenv('WORKDIR') differs than I expect, then I finally found the statement fastcgi_param WORKDIR /usr/jails; in /usr/local/etc/nginx/sites-enabled/cbsdweb.conf was wrong.

I hardly found this statement because there's no information about this file (and envvar) in the install manual nor after install message, so I will write PR to add additional info in case of not-default $WORKDIR.