Quantcast
Channel: Ocsinventory Q&A - Recent questions without answers
Viewing all articles
Browse latest Browse all 4609

OCS_DB_HOST not working on OCS ng Server 2.5

$
0
0

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

  PerlSetEnv OCS_DB_HOST 192.168.1.8 <-- 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='192.168.1.8'; <-- 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?


Viewing all articles
Browse latest Browse all 4609


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>