Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.9.1 available

The official documentation can be found on http://wiki.ocsinventory-ng.org. Read it before asking your question.

OCS_DB_HOST not working on OCS ng Server 2.5

i  modify /etc/httpd/conf.d/z-ocsinventory-server.conf

  PerlSetEnv OCS_DB_HOST <-- this is my DB server

when i test inventory . apache httpd alway show error below

[Fri Sep 21 12:01:19.272114 2018] [perl:error] [pid 13622] [client XXX.XXX.XXX.XXX:58005] Can't call method "rollback" on an undefined value at /usr/local/share/perl5/Apache/Ocsinventory/Server/System.pm line 282.\n
DBI connect('database=ocsweb;host=localhost;port=3306','ocs',...) failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at /usr/local/share/perl5/Apache/Ocsinventory/Server/System.pm line 187.
[Fri Sep 21 12:01:44.147164 2018] [perl:error] [pid 13640] [client XXX.XXX.XXX.XXX:58009] Can't call method "rollback" on an undefined value at /usr/local/share/perl5/Apache/Ocsinventory/Server/System.pm line 282.\n

it seems  cann't pass OCS_DB_HOST to /Apache/Ocsinventory/Server/System.pm . i  solve it below code

  $host=''; <-- add this line force host ip
  # Connection...
  my $dbh = DBI->connect("DBI:mysql:database=$database;host=$host;port=$port", $user, $password, \%params);

but it seems a bug. anyone can fix it?

in OCS Inventory NG server for Unix by (120 points)

1 Answer

0 votes
Did you change info in : dbconfig.inc.php  (I think it is in /usr/share/ocsinventory-reports/ocsreports)

by (3.7k points)
Powered by Question2Answer