I'm currently trying to connect to a MSSQL database, but from what i've read so far, there are actually extensions and files that i need to download from microsoft itself which i've went and download it here.
https://www.microsoft.com/en-us/download/details.aspx?id=20098
The error that i'm receiving currently receiving is the following.
Fatal error: Uncaught Error: Call to undefined function sqlsrv_connect() in C:\xampp\htdocs\index.php:5 Stack trace: #0 {main} thrown in C:\xampp\htdocs\index.php on line 5
As far as i understand, i know that i'm supposed to append some extensions into the php.ini located in my xampp\php\php.ini file. However, even after appending the file from microsoft, i still can't seem to get connected.
I heard some people mentioned that the php version that i'm using which is currently PHP Version 7.1.1 has some issues connecting back to MSSQL databases but i'm not entirely sure.
Would someone be able to point me to right direction? i've tried looking up and down appending different files into the extension but i still can't seem to do it.
Thank you very much in advance.
edit:
PHP 7 on IIS: Call_user_function could not be located
i've also visited this link, however i'm unsure whether if this is related to the issue I have as i'm on 7.1
Related
I'm trying to connect to a Firebase Database server but I'm getting:
PHP Fatal error: Uncaught Error: Call to undefined function ibase_connect()
It was working good, but today it started to throw that error. I've been for the last hours searching on the internet in every page, even in Portuguese, but nothing helps.
Almost in every post they are dealing with W/L/XAMPP, but that doesn't help.
I'm trying this on a valueserver shared host (I don't even know which company is that). PHP Version: 7.2.1
The file is running via cron job.
This is what I'd tried:
Verify in php.ini that interbase is uncommented.
Look for server errors (none).
Please I don't know what to do.
I am trying to shadow a live website to my local machine, I have finished all the copy thing for home folder and database from cpanel.
So far, I didn't make any change on code part, and just installed xampp and set up phpmyadmin.
after I set the localhost, and loaded the local page then below message displayed.
Fatal error: Uncaught Error: Call to undefined function
mysql_connect() in F:\htdocs\ramtaps\includes\php_library.inc:41 Stack
trace: #0 F:\htdocs\ramtaps\includes\php_library.inc(19):
phpLibrary->createGlobalDatabaseConnection() #1
F:\htdocs\ramtaps\includes\php_library.inc(469):
phpLibrary->__construct() #2
F:\htdocs\ramtaps\includes\config\master.php(859):
include('F:\\htdocs\\ramta...') #3 F:\htdocs\ramtaps\index.php(4):
include('F:\\htdocs\\ramta...') #4 {main} thrown in
F:\htdocs\ramtaps\includes\php_library.inc on line 41
So I looked into the code and it said that mysql_connect is deprecated.
I am pretty new one this field and tried few things and they didn't work so far.
If anyone advises me regarding on this, I would really appreciate.
although you did not mention your PHP version, it is obvious that you are using PHP with version > 7
mysql_connect was removed in PHP 7.0.0 and above
http://php.net/manual/en/migration70.incompatible.php
either install older version of PHP, or change your code
and maybe this is usefull for you http://php.net/manual/en/mysqlinfo.api.choosing.php
I know there are tons of questions about this on SO. But I've been trying to fix this since a month with no luck.
At work we have this very old website that uses an access database, and I cannot do anything about it.I want to work on some changes on my local PC using wamp server. So I donwloaded the website along with the db. Here is how it's supposed to connect :
$conn = new COM('ADODB.Connection');
$db = realpath("dbalerts.mdb");
$conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=$db");
But it's giving me this error:
Fatal error: Uncaught exception 'com_exception' with message 'Source: ADODB.Connection
Description:Provider cannot be found. It may not be properly installed.'
in C:\wamp\www\testaccess\index.php:5 Stack trace: #0 C:\wamp\www\testaccess\index.php(5): com->Open('Provider=Micros...') #1 {main} thrown in C:\wamp\www\testaccess\index.php on line 5
It's a test folder whith an index.php where only that code is written. In the same folder is dbalerts.mdb
I tried everything I know. I downloaded AccessDatabaseEngine.exe from MS website which is supposed to have the driver. And it installed properly with no errors( had to uninstall office because it was 64bit)
I am on a win8 machine
Any ideas how I can fix this all while still using COM and ADODB? Because I can't go through changing the connections of every .php file in that website (it's old and poorly designed so not adaptable to changes)
I am trying to run LWT on my mac and have installed MAMP for this. I have followed these instructions, but when I try to go to http://localhost:8888/lwt/ I am getting:
The localhost page isn’t working
localhost is currently unable to handle this request.
500
I have created a different folder in my htdocs folder and created a php file in it (index.php), with some code to see if php is working:
<?php
echo "this is the start";
phpinfo();
echo "<br>this is the end";
?>
That is all fine and works. I have also checked the user-rights for the lwt folder, but it seems fine too (Admins & Me are Read&Write, Others are ReadOnly). Typing tail -f /Applications/MAMP/logs/php_error.log into the terminal gives me the following error log:
PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /Applications/MAMP/htdocs/lwt/utilities.inc.php:3272
Stack trace:
#0 /Applications/MAMP/htdocs/lwt/index.php(46): require_once()
#1 {main}
thrown in /Applications/MAMP/htdocs/lwt/utilities.inc.php on line 3272
I am a beginner though, so I don't know what else the problem could be. Any ideas?
I don't know which version of PHP you use. But the mysql_* function are deprecated and its possible that its not included in your new version anymore. Use mysqli_* to connect to your database or use PDO.
In the new version of MAMP is PHP7 included. Perhaps you use that.
I am developing a website using PHP and mongodb. I access the mongodb with PECL-mongo, and have run into an annoyance. Every now and then, I get an error like this (I've anonymized the paths)
Fatal error: Uncaught exception 'MongoCursorException' with message 'couldn't get response header' in
/PATH/index.php:38 Stack trace: #0
/PATH/index.php(38): MongoCursor->rewind() #1
/PATH/template.inc(29): get_sidebar() #2
/PATH/index.php(13):
require_once('PATH/...') #3 {main} thrown in PATH/index.php on line 38
According to the documentation, this means:
The driver could not fetch a reply header from the database, so it
gave up. Check if the database is still up and the network is
connected and try the query again.
But I know that the database is up because I am doing this locally on my own machine over loopback. No connection is made to the outside world.
Simply trying again often works. Is this a possibly a bug in PHP's driver for mongo? Could this be a "miscompile" issue (I compiled from source, but with very benign flags, -march=native -O2)?
Has anyone seen this before?
Searching around, I only see references to some stupid facebook game having the same error.
EDIT: I just downgraded my PECL driver to version 1.1.4 and so far, the problem seems have gone away. So this may simply be a bug in the 1.2.x series. If anyone can shed any light on it, that would be great.
EDIT: I am not doing anything complex here, the code that is having the issue litterally looks like this:
$m = new Mongo();
$collection = $m->my_db->collection;
$results = $collection->find(array("favorite"=>true))->limit(5);
i solved this problem with get new version mogodb.dll
you can see http://www.mongodb.org/display/DOCS/PHP+Language+Center