Call to undefined function db2_connect() error is occured - php

My db2 database is on windows machine
my php application on Linux machines on xamp
when i start my app then error is occured
error is :- Call to undefined function db2_connect()

DB2 is an extension and must be installed separately before its functions are made available.
http://php.net/manual/en/ibm-db2.installation.php

You need to enable the ibm db2 extension:
http://php.net/manual/en/ibm-db2.installation.php

Related

Call to undefined function svn_auth_set_parameter() in php

While I trying connect svn using php svn package in windows xampp and I got the below error.
Uncaught Error: Call to undefined function svn_auth_set_parameter()
I have followed
https://www.php.net/manual/en/svn.installation.php manual and installed svn module in php and enabled extension=php_svn in php.ini file.
Here the sample code I have used
svn_auth_set_parameter(SVN_AUTH_PARAM_DEFAULT_USERNAME, 'my username');
svn_auth_set_parameter(SVN_AUTH_PARAM_DEFAULT_PASSWORD, 'password');

Invalid packet type error using php_mysql_xdevapi

I am trying to connect to mysql 8.0.15 using php_mysql_xdevapi but getting following errror.
Notice: mysql_xdevapi\getSession(): send of 5 bytes failed with errno=10053 An established connection was aborted by the software in your host machine.
Fatal error: Uncaught mysql_xdevapi\Exception: [2000][HY000] The server sent invalid packet type
I am using
Windows 10
MySQL 8.0.15
PHP 7.3.0
PECL Extension MySQL X DevAPI for PHP
Finally after 2 days of searching, I make php_mysql_xdevapi work on windows using wampserver.
Steps to make php_mysql_xdevapi work on windows 10, using wamp.
Install Pecl extension php_mysql_xdevapi.
Add the extension into the ini extension=php_mysql_xdevapi
Be default in wamp the XPlugin is disable enable it in my.ini
;Disabling X Plugin
;mysqlx=0
use this to connect to mysql using php_mysql_xdevapi
$session = mysql_xdevapi\getSession('mysqlx://root:123#localhost:33060?connect-timeout=5000&ssl-mode=disabled');
Now you can use this to further query in mysql document store.

Memcache.exe failed to install service or service already installed

I installed xampp on my local computer. The data in the project is stored in memory, but the memcached function did not work on my local machine.
$memcache=memcache_connect('127.0.0.1', 11211);
Error code:
Fatal error: Call to undefined function memcache_connect() in
I called the error, but the solutions didn't work for me.
Suggested solutions include the addition of new services
I am getting this error when adding new service
"failed to install service or service already installed"
**Windows 7
**Xampp
**Apache/2.4.34 (Win32) OpenSSL/1.0.2o PHP/5.6.38

Call to a member function num_rows() on boolean error in wamp and lamp but not in xampp

I am working on Point of sale system built on codeigniter. I get this error "Call to a member function num_rows() on boolean". I have just moved to linux and install lamp. I get the similar error on wamp, at that time i removed wamp and install xampp and it work. now i want to use lamp , every thing is good expect it get this error. I have changed php version but it does not help. i can not change in code because it has been used in hundred of places. currently i am using php PHP Version 7.0.27 , Apache/2.4.18, sql version :mysqladmin Ver 8.42 Distrib 5.7.20, for Linux on x86_64. also why it is working in xampp but give error on wamp and lamp,
Here is full error
An uncaught Exception was encountered
Type: Error
Message: Call to a member function num_rows() on boolean
Filename: /var/www/html/dev.com/public_html/gspos/app/models/admin/Products_model.php
Line Number: 206
Backtrace:
File: /var/www/html/dev.com/public_html/gspos/app/controllers/admin/Products.php
Line: 2053
Function: getAllWarehousesWithPQ
File: /var/www/html/dev.com/public_html/gspos/index.php
Line: 302
Function: require_once
I think you have code smells, but if you can't edit it, maybe check the differences between Xampp config and your new config and begin by check php version.
Thanks for the Help . I just installed Xampp and it solved my problem

How to connect to MS SQL Server 2016 from PHP 7

I'm attempting to insert rows in table in a database hosted in MS SQL Server 2016 installed in my local computer.
Here is my snippet $dbc = mssql_connect('MwangiCJ-PC/mwangi','sqluser','xxxx','mydb');
I have tried out the answer from
mssql_connect() with PHP5 and MSSQL2012 Express but I still get the error Fatal error: Uncaught Error: Call to undefined function mssql_connect()
When i run a simple phpinfo() I can see that I already have both sqlsrv and pdo_sqlsrv available.
Am I missing anything else? Please help. Thank you.
From the PHP docs:
Warning
This function was REMOVED in PHP 7.0.0.
Alternatives to this function include:
PDO::__construct()
sqlsrv_connect()
odbc_connect()

Categories