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.12.3 available

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

/ocsreports/install.php not running

Good day.

Installed OCS 2.9.1

But, When trying to run

http://server_name/ocsreports/install.php

in browser window does not appear  OCS Inventory Installation - simply white background.

Apache24 in access log:

[05/Oct/2021:11:17:58 +0300] "GET /ocsreports/install.php HTTP/1.1" 500 -

Apache24 error log:
proxy_fcgi:error] [pid 6889:tid 34438453248]  AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function session_start() in /usr/share/ocsinventory-reports/ocsreports/require/function_commun.php:23\nStack trace:\n#0 /usr/share/ocsinventory-reports/ocsreports/install.php(26): require_once()\n#1 {main}\n  thrown in /usr/share/ocsinventory-reports/ocsreports/require/function_commun.php on line 23'

How resolved?

in OCS Inventory NG server for Unix by (640 points)
edited by

17 Answers

0 votes
Hi,

All needed php modules are installed ? Have you restarted apache after installation ?

Regards

Frank
by (90.4k points)
0 votes
Another solution (to be sure to 'have all prerequesites') :
read the tutorial in https://ask.ocsinventory-ng.org/13105/tutorial-ocsserver-2-9-on-debian-10-buster

Ok, it's for Debian 10 (or 11), but it's OK to run.
by (20.1k points)
edited by
0 votes

I install on FreeBSD 12.2 OCS 2.9.1.

mariadb  Ver 15.1 Distrib 10.4.21-MariaDB, for FreeBSD12.2 (amd64)

This is perl 5, version 32,

PHP 7.4.23 (cli)

There is a list of required  php and perl modules?

http://wiki.ocsinventory-ng.org/01.Prerequisites/Libraries-version/ - This is not a complete list ?

/ocsinventory-reports/ocsreports/require/function_commun.php on line 23':

@session_start();

by (640 points)
0 votes
You've found the prerequisites pour PHP. Good.

You can verify with phpinfo(). Give us the results ...

I suppose you server have AND Communication Service (/ocsinventory with Perl module) AND Administration Service (/ocsreports with Php module).

IMHO it's more difficult to get all Perl dependencies (you'll need to get CPAN command ...).

Also, with lot of tutos available on Internet, with easy Debian or Centos distribution, you can create a server ready in less than 1 hour : myself, 2 months ago, with my own Proxmox at home, I've created 5 new VM fully operationnal based on Debian Buster with OCS 2.4, 2.5, 2.6, 2.7 and 2.8.1 fully operational ... in less 2 hour, using my own tuto nearly similar as the link supplied. (new = installation of OS included, it was easy doing the 5 VM simultaneously, step for one, same step for next, and so ...)
by (20.1k points)
0 votes

list of required  php modules:

php -m
[PHP Modules]
bcmath
Core
ctype
curl
date
dom
fileinfo
filter
gd
gettext
hash
json
ldap
libxml
mbstring
mysqli
mysqlnd
openssl
pcre
Reflection
session
SimpleXML
snmp
soap
sockets
SPL
standard
xml
xmlreader
xmlwriter
zip
zlib

[Zend Modules]

Now window  OCS Inventory Installation appear.
I try further.

by (640 points)
0 votes

with phpinfo() all good.

and apache24 also.

by (640 points)
0 votes
When performing OCS-NG Inventory Installation:

ERROR: Can't connect to MySQL.

ERROR: MySql connection problem 2002
No such file or directory

But mariadb running.

proxy_fcgi:error] [pid 1455:tid 34442733568]  AH01071: Got error 'PHP message: PHP Warning:  mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in /usr/share/ocsinventory-reports/ocsreports/require/function_commun.php on line 67PHP message: PHP Warning:  mysqli_query() expects parameter 1 to be mysqli, null given in /usr/share/ocsinventory-reports/ocsreports/require/function_commun.php on line 104PHP message: PHP Warning:  mysqli_fetch_object() expects parameter 1 to be mysqli_result, null given in /usr/share/ocsinventory-reports/ocsreports/require/function_commun.php on line 38', referer: https://...la.com/ocsreports/install.php

How resolve?
by (640 points)
edited by
0 votes
After installation of OCS, you have to setup database access.

Look at https://wiki.ocsinventory-ng.org/03.Basic-documentation/Setting-up-a-OCS-Inventory-Server/ at the end 'Configuring management server'.

Before running /ocsreports/install.php, I suggest you create database (ocsweb) and user (ocsuser better than ocs), and grant rights for the user. Then you can launch initialization. So you can see if php script could access MariaDB database ...

(For setting database, you can read https://wiki.ocsinventory-ng.org/03.Basic-documentation/Deploying-database-server/ please note DO NOT use 'ocs' as user, and use 'flush privileges' before running install.php ...)
by (20.1k points)
0 votes

Database created, user ocs also with grant all for database ocsweb.

Mysql -u ocs -p  comes in.

But install.php error after entering credentials:

ERROR: MySql connection problem 2002
No such file or directory

How did you write; php script not could access MariaDB database ...

How resolve?

by (640 points)
0 votes

You can test using https://www.cloudways.com/blog/connect-mysql-with-php/

The page give a short sample script 'db_connnection.php'. Try ...

If it's nok, no chance OCS would run ...

(I wrote 'DO NOT use ocs' as username : when it will be OK, you'll receive an alert message !)

(If you want a very simple access to database, you cant use 'adminer' : only 1 file to install in the folder, it's very simple.)

by (20.1k points)
edited by
 
Powered by Question2Answer
...