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.

PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: [closed]

Good day,

I have installed OCS inventory 2.1.2 on a ubuntu 14.04 server.
This is my first time,

Apache version 2.4.7
MySQL version 5.5.40

I can log in the website (created by setup.sh http:\\wd-vglpi015\ocsreports )

I have installed the agent on my windows 8.1 machine. It wil run but the machine is not coming into ocsinventory website. On the Apache.error.log I get this message,

[Fri Nov 28 08:43:37.636534 2014] [:error] [pid 4647] [client 192.168.3.161:52146] PHP Deprecated:  mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /usr/share/ocsinventory-reports/ocsreports/backend/require/connexion.php on line 10, referer: http://wd-vglpi015.aalsmeer.waterdrinker.nl/ocsreports/
[Fri Nov 28 08:43:38.747690 2014] [:error] [pid 4647] [client 192.168.3.161:52146] PHP Deprecated:  mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /usr/share/ocsinventory-reports/ocsreports/backend/require/connexion.php on line 10, referer: http://wd-vglpi015.aalsmeer.waterdrinker.nl/ocsreports/?function=visu_groups
[Fri Nov 28 08:43:40.590821 2014] [:error] [pid 4647] [client 192.168.3.161:52146] PHP Deprecated:  mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /usr/share/ocsinventory-reports/ocsreports/backend/require/connexion.php on line 10, referer: http://wd-vglpi015.aalsmeer.waterdrinker.nl/ocsreports/?function=visu_computers

In the apache acces.log I see this

f9bjmq1-w8.aalsmeer.waterdrinker.nl - - [28/Nov/2014:08:43:12 +0100] "POST /ocsreports HTTP/1.1" 301 524 "-" "OCS-NG_WINDOWS_AGENT_v2.1.1.1"
f9bjmq1-w8.aalsmeer.waterdrinker.nl - - [28/Nov/2014:08:43:12 +0100] "GET /ocsreports/ HTTP/1.1" 200 4373 "-" "OCS-NG_WINDOWS_AGENT_v2.1.1.1"

This the log from my local computer,
==============================================================================
Starting OCS Inventory NG Agent on Friday, November 28, 2014 08:35:15.
AGENT => Running OCS Inventory NG Agent Version 2.1.1.1
AGENT => Using OCS Inventory NG FrameWork Version 2.1.1.1
AGENT => Loading plug-in(s)
    DLL PLUGIN => Searching for Plug-in DLL(s) in folder <C:\Program Files (x86)\OCS Inventory Agent\plugins>
    DLL PLUGIN => 0 DLL Plug-in(s) succesfully loaded on 0 DLL(s) found
AGENT => Using network connection with Communication Server
    COM PROVIDER => Loading Communication Provider <C:\Program Files (x86)\OCS Inventory Agent\ComHTTP.dll>
AGENT => Using Communication Provider <OCS Inventory NG cURL Communication Provider> Version <2.1.1.1>
AGENT => Sending Prolog
    DID_CHECK => Read DeviceID <F9BJMQ1-W8-2014-11-27-09-49-13> and MACs <08:11:96:34:88:D0D0:67:E5:39:B2:4C60:D8:19:F8:A3:9D08:11:96:34:88:D1> in file <ocsinventory.dat>
    COM SERVER => Initializing cURL library for sendRequest
    COM SERVER => Using cURL without server authentication
    COM SERVER => Disabling cURL proxy support
    COM SERVER => Enabling cURL SSL server validation support using CA Bundle <C:\ProgramData\OCS Inventory NG\Agent\cacert.pem>
    COM SERVER => Sending HTTP Post request to URL <http://wd-vglpi015/ocsreports>
    COM SERVER => HTTP Post response received <HTTP Status Code #200>
    COM SERVER => Cleaning cURL library
================= TRACE START ===============

================= TRACE STOP ===============
AGENT => Prolog successfully sent
SUPPORT => No support detected, Registration key : N/A
    AGENT => Prolog Frequency set to 10 hour(s)
AGENT => Unloading communication provider
AGENT => Unloading plug-in(s)
AGENT => Execution duration: 00:00:00.

And here is my local ocsinventroy.ini file

[OCS Inventory Agent]
ComProvider=ComHTTP.dll
Debug=2
Local=
NoSoftware=0
HKCU=0
NoTAG=0
IpDisc=
[HTTP]
Server=http://wd-vglpi015/ocsreports
SSL=1
CaBundle=cacert.pem
AuthRequired=0
User=
Pwd=
ProxyType=0
Proxy=
ProxyPort=0
ProxyAuthRequired=0
ProxyUser=
ProxyPwd=
[OCS Inventory Service]
PROLOG_FREQ=10
OLD_PROLOG_FREQ=10
TTO_WAIT=35820

I have tried to rename in connexion.php the mysql_connect to mysqli_connect but then the website doesn't work anymore.

Anybody ideas for me?

 

closed with the note: the solutions was provided in the answer
in OCS Inventory NG server for Unix by (130 points)
closed by

1 Answer

+1 vote

Hi

This line is not correct. You must have server=http://wd-vglpi015/ocsinventory.

http://wd-vglpi015/ocsreports is reserved to join ocs server gui with a browser.

Stop ocsinventory service on each client. Modify ocsinventory.ini; Start ocsinventory service.

PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:

This is just a warning message, not related to your problem.

by (90.4k points)
Hai Frank,

when I start the agent now on my windows client this is the agent logfile.
It will not be send anymore.
(ps in apache there is made a virtual directory called ocsreports and not ocsinventory. )

*********************************************************

Starting OCS Inventory NG Agent on Friday, November 28, 2014 13:19:42.
AGENT => Running OCS Inventory NG Agent Version 2.1.1.1
AGENT => Using OCS Inventory NG FrameWork Version 2.1.1.1
AGENT => Loading plug-in(s)
    DLL PLUGIN => Searching for Plug-in DLL(s) in folder <C:\Program Files (x86)\OCS Inventory Agent\plugins>
    DLL PLUGIN => 0 DLL Plug-in(s) succesfully loaded on 0 DLL(s) found
AGENT => Using network connection with Communication Server
    COM PROVIDER => Loading Communication Provider <C:\Program Files (x86)\OCS Inventory Agent\ComHTTP.dll>
AGENT => Using Communication Provider <OCS Inventory NG cURL Communication Provider> Version <2.1.1.1>
AGENT => Sending Prolog
    DID_CHECK => Read DeviceID <F9BJMQ1-W8-2014-11-27-09-49-13> and MACs <08:11:96:34:88:D0D0:67:E5:39:B2:4C60:D8:19:F8:A3:9D08:11:96:34:88:D1> in file <ocsinventory.dat>
    COM SERVER => Initializing cURL library for sendRequest
    COM SERVER => Using cURL without server authentication
    COM SERVER => Disabling cURL proxy support
    COM SERVER => Enabling cURL SSL server validation support using CA Bundle <C:\ProgramData\OCS Inventory NG\Agent\cacert.pem>
    COM SERVER => Sending HTTP Post request to URL <http://wd-vglpi015/ocsinventory>
    COM SERVER => HTTP Post response received <HTTP Status Code #400>
    COM SERVER => Cleaning cURL library
================= TRACE START ===============

================= TRACE STOP ===============
ERROR *** AGENT => Failed to send Prolog <HTTP Status Code #400>
AGENT => Unloading communication provider
AGENT => Unloading plug-in(s)
AGENT => Execution duration: 00:00:01.

 

The Apache virtual Directory are pointing to this,

/ocsreports    /usr/share/ocsinventory-reports/ocsreports
/download    /var/lib/ocsinventory-reports/download
/snmp        /var/lib/ocsinventory-reports/snmp
Hi

Which version of ocs server have you installed, because error 400 means that server version is lower than agent version.

I reply my self. You installed ocs server 2.1.2 and use ocs agent 2.1.1.

Can you post contents of activity.log and apache error_log files?
Strange, I created a new virtual directory /ocsinventory on the apache.
When I try to log on a get a 400 BAD request. (nothing in the apache error.log)

But when I open /ocsreports It works fine for the website.

I also notice that there are no log file in the /var/log/ocsinventory-server directory.

Hai Frank,
Here I have the lins from apache error.log

[Fri Nov 28 09:39:30.394190 2014] [:error] [pid 5948] [client 192.168.3.161:53583] PHP Deprecated:  mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /usr/share/ocsinventory-reports/ocsreports/backend/require/connexion.php on line 10, referer: http://wd-vglpi015.aalsmeer.waterdrinker.nl/ocsreports/index.php?function=visu_computers
[Fri Nov 28 09:39:30.395133 2014] [:error] [pid 5948] [client 192.168.3.161:53583] PHP Deprecated:  mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /usr/share/ocsinventory-reports/ocsreports/backend/require/connexion.php on line 10, referer: http://wd-vglpi015.aalsmeer.waterdrinker.nl/ocsreports/index.php?function=visu_computers
[Fri Nov 28 09:39:30.396270 2014] [:error] [pid 5948] [client 192.168.3.161:53583] PHP Deprecated:  mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /usr/share/ocsinventory-reports/ocsreports/backend/require/connexion.php on line 10, referer: http://wd-vglpi015.aalsmeer.waterdrinker.nl/ocsreports/index.php?function=visu_computers
[Fri Nov 28 13:19:49.682499 2014] [:error] [pid 5948] [client 192.168.3.161:56841] PHP Deprecated:  mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /usr/share/ocsinventory-reports/ocsreports/backend/require/connexion.php on line 10, referer: http://wd-vglpi015.aalsmeer.waterdrinker.nl/ocsreports/index.php?function=visu_computers
[Fri Nov 28 13:19:49.682929 2014] [:error] [pid 5948] [client 192.168.3.161:56841] PHP Deprecated:  mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /usr/share/ocsinventory-reports/ocsreports/backend/require/connexion.php on line 10, referer: http://wd-vglpi015.aalsmeer.waterdrinker.nl/ocsreports/index.php?function=visu_computers
[Fri Nov 28 13:19:49.683598 2014] [:error] [pid 5948] [client 192.168.3.161:56841] PHP Deprecated:  mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /usr/share/ocsinventory-reports/ocsreports/backend/require/connexion.php on line 10, referer: http://wd-vglpi015.aalsmeer.waterdrinker.nl/ocsreports/index.php?function=visu_computers
[Fri Nov 28 13:50:13.659786 2014] [mpm_prefork:notice] [pid 5944] AH00171: Graceful restart requested, doing restart
[Fri Nov 28 13:50:14.272130 2014] [ssl:warn] [pid 5944] AH01909: RSA certificate configured for glpi.aalsmeer.waterdrinker.nl:443 does NOT include an ID which matches the server name
[Fri Nov 28 13:50:14.272591 2014] [mpm_prefork:notice] [pid 5944] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.5 OpenSSL/1.0.1f mod_perl/2.0.8 Perl/v5.18.2 configured -- resuming normal operations
[Fri Nov 28 13:50:14.272608 2014] [core:notice] [pid 5944] AH00094: Command line: '/usr/sbin/apache2'
[Fri Nov 28 13:50:17.138954 2014] [mpm_prefork:notice] [pid 5944] AH00169: caught SIGTERM, shutting down
[Fri Nov 28 13:50:21.642202 2014] [ssl:warn] [pid 8559] AH01909: RSA certificate configured for glpi.aalsmeer.waterdrinker.nl:443 does NOT include an ID which matches the server name
[Fri Nov 28 13:50:22.031606 2014] [ssl:warn] [pid 8560] AH01909: RSA certificate configured for glpi.aalsmeer.waterdrinker.nl:443 does NOT include an ID which matches the server name
[Fri Nov 28 13:50:22.084813 2014] [mpm_prefork:notice] [pid 8560] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.5 OpenSSL/1.0.1f mod_perl/2.0.8 Perl/v5.18.2 configured -- resuming normal operations
[Fri Nov 28 13:50:22.084942 2014] [core:notice] [pid 8560] AH00094: Command line: '/usr/sbin/apache2'
[Fri Nov 28 13:57:08.901326 2014] [mpm_prefork:notice] [pid 8560] AH00169: caught SIGTERM, shutting down
[Fri Nov 28 13:57:30.830086 2014] [ssl:warn] [pid 1054] AH01909: RSA certificate configured for glpi.aalsmeer.waterdrinker.nl:443 does NOT include an ID which matches the server name
[Fri Nov 28 13:46:50.204432 2014] [ssl:warn] [pid 1152] AH01909: RSA certificate configured for glpi.aalsmeer.waterdrinker.nl:443 does NOT include an ID which matches the server name
[Fri Nov 28 13:46:50.281003 2014] [mpm_prefork:notice] [pid 1152] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.5 OpenSSL/1.0.1f mod_perl/2.0.8 Perl/v5.18.2 configured -- resuming normal operations
[Fri Nov 28 13:46:50.281196 2014] [core:notice] [pid 1152] AH00094: Command line: '/usr/sbin/apache2'

 

Can you tell me where to find the activity.log? I don know where it is.

 

Got it to work. I was to fast.
First off all. I made myself a virutal directory on apache  that pointed out to ocsinventory. (This is not ok)
I removed this virtual directory as axplained in http://forums.ocsinventory-ng.org/viewtopic.php?id=13766

Than I ran the agent again on my computer, and looked in http://server/ocsreports and found 1 computer was added smiley

Thanxs FrankB

 

PS found the activity log on /var/log/ocsinventory-server This is made when I removed the virtual directory from apache.

 

 

 
Powered by Question2Answer
...