[GH-ISSUE #5] php error #2

Closed
opened 2026-03-02 03:21:11 +03:00 by kerem · 3 comments
Owner

Originally created by @daizus on GitHub (Oct 11, 2017).
Original GitHub issue: https://github.com/clonos/control-pane/issues/5

Originally assigned to: @olevole on GitHub.

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

Originally created by @daizus on GitHub (Oct 11, 2017). Original GitHub issue: https://github.com/clonos/control-pane/issues/5 Originally assigned to: @olevole on GitHub. 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
kerem closed this issue 2026-03-02 03:21:12 +03:00
Author
Owner

@olevole commented on GitHub (Dec 7, 2017):

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

<!-- gh-comment-id:350099889 --> @olevole commented on GitHub (Dec 7, 2017): notes for myself: most likely caused by the absence of additional CBSD modules for the ClonOS database
Author
Owner

@olevole commented on GitHub (Jan 17, 2018):

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!

<!-- gh-comment-id:358440698 --> @olevole commented on GitHub (Jan 17, 2018): 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!
Author
Owner

@windymelt commented on GitHub (May 16, 2019):

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.

<!-- gh-comment-id:493154154 --> @windymelt commented on GitHub (May 16, 2019): 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`.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/control-pane#2
No description provided.