So apparently I'm a lucky bastard and got problems with this function in my localhost ever since I know myself.
I can't change the connection to PDO due to the code simply isn't mine and have more than 100 files with this connection, so I have to keep them, and connect into my localhost with them, so I can edit and work on it while on my machine.
When I try to connect with mssql_connect() the following error is displayed: Fatal error: Call to undefined function mssql_connect()
Searching on all type of questions here, I found that mssql_connect() doesn't work anymore on 5.3 versions + of php, but there is some .dll that Windows itself provides to those who still want to work with this function.
The .dll files are:
php_sqlsrv_54_nts.dll and php_sqlsrv_54_ts.dll
I'm using 54 because my php version is 5.4.45
Even though, still not working, the .dlls are enabled in php.ini, but the message keeps showing.
Does anyone REALLY have a solution to this problem? I really need to keep using this functions...
Thanks!
Related
Currently, I am getting an error
fatal error: undefined function ldap_connect()
I am assuming this is because I do not have the library php_ldap.dll, but I am unsure how to even obtain it. Basically, I'm trying to get it so that ldap driver appears on the phpinfo page.
Please do not mark this question as duplicate: Fatal error: Call to undefined function: ldap_connect(). This solution works for Linux and Windows, but does not work on Mac OS.
Any input would be appreciated.
When you are on a Mac php_ldap.dll won't help you as that's a windows file.
If you are using MAMP you should have a look at the MAMP documentation to see how to enable other extensions. IIRC there is a possibility to enable extensions in the preferences somewhere but I might be wrong or that has changed since I looked the last time. If there is that possibility, you should be able to enable the LDAP extension there.
I would like to change php version to 7.1 and i have an error:
PHP Warning: PHP Startup: Unable to load dynamic library
'C:\Program Files\PHP\v7.1\ext\php_sqlsrv_7_nts_x86.dll' - The specified procedure could not be found.
in Unknown on line 0
First think. This is not duplicate question because i checked many similar questions.
I'm using IIS, PHP 7.1, and SQL server (thats why i need sqlsrv drivers).
I checked php.ini file aready and i change extension-dir path to full path but nothing happens. (Logically if path is a problem why it works with other extensions? ).
It works with PHP 7.0.7 (all enabled extensions is exactly same)
Update: still won't work but i tried to paste path from error message to file explorer and file already there.
Turns out that PHP 7.0 and PHP 7.1 are not compatible and the mssql PDO drivers are for 7.0.
Github issue here
Also ensure you including the right 64/86 and ts/nts version.
As from Toby Allen's accepted answer above 7.0 and 7.1 are incompatible,
However Microsoft has released Preview versions of the drivers for 7.1.
This worked for me, hope it helps anyone searching.
Drivers can be found here under downloads
I had this issue yesterday. The key to the error is the last bit.
The specified procedure could not be found.
In my case I went through a painful amount of debugging. The first thing that I noticed was that when I ran a hello world php file, I didn't get this error. That indicated to me it wasn't actually a problem loading the file, it was a problem calling a function in the file.
I went in and repeatedly put die() statements in and moved it until it hit the error. It took awhile but I eventually discovered I was calling sqlsrv_connect with options that were (apparently) now invalid.
So I can't say the exact cause of your issue without seeing the code that actually causes the error, but I hope this at least points you in the right direction.
So far I am using WAMP server with oracle successfully past one year,but unfortunately it stopped working and displaying an error like this Fatal error: Call to undefined function oci_connect(). I verified all DLL files and connection I dint do any modification for past one year and verified all related link Fatal error: Call to undefined function oci_connect().How can I fix this error.kind give some solution.
I have refer and verified lots of reference links. But everything is perfect. Past 1 year it was working perfectly, but today morning it will not work and shown the above error here, How can I solve this?
May be dll was crashed. Can you update the required dlls?
Otherwise reinstall the Oracle?
It will work..
Please check your PHP version first. it must be not latest one also your wamp server is around 2.2.
Please add require oracle extension from here.
Add
php_oci8_11g.dll
In php.ini and enable extension.
Its working for me. Still have issue let me know.
Thanks for your help in advance. I have been working on this bug for more than 12 hours now.
There is an AJAX signup form in my Heroku site which runs on MySQL and is connected to ClearDB Database. I can successfully send data to the database on my local server (MAMP). However, I cannot do the same on the server.
The requests cannot get send to the database and gets stuck at loading. Upon inspection I realise it is a PHP 500 Error.
I found the key problem in the Heroku logs. 2014-11-24T15:02:31.238493+00:00 app[web.1]: [24-Nov-2014 15:02:30 UTC] PHP Fatal error: Call to undefined function mysql_connect() in /app/index.php on line 5
Line 5 of the index.php is mysql_connect('hostname', 'username, 'password');
I have tried running php_getinfo(); and found that there is no MySQL support in the server. On a side note, I have MySQL support in my localhost.
The server php.ini paths are as such: Configuration File (php.ini) Path /app/.heroku/php/etc/php & Loaded Configuration File /app/vendor/heroku/heroku-buildpack-php/conf/php/php.ini
What should I do?
mysql_* functions are deprecated and actually removed in the next PHP version. Check out mysqli.
Worth noting that you can enable mysql_* on Heroku via composer.json. This is documented in Heroku's devcenter docs on PHP support.
Also recommend you consider using a more modern MySQL library, though :)
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
PHP Fatal error: Call to undefined function mssql_connect()
I am developing a light-weight PHP application which accesses a remote SQL server db.
So far, I am out of luck in getting connection setup to SQL Server db through my PHP script.
I keep getting this error when I am trying to connect to sql DB:
Fatal error: Call to undefined function mssql_connect()
I get similar error when I try sqlsrv_connect($myServer, $myUser, $myPass) too
Here is what I have already tried:
I search for solution on web for hours, but nothing works.
I downloaded drivers from http://www.microsoft.com/en-us/download/details.aspx?id=20098
and unzipped them into php/ext folder
modified php.ini to add newly downloaded drivers lines:
extension=php_sqlsrv_54_ts.dll
extension=php_pdo_sqlsrv_54_ts.dll
[sqlsrv]
sqlsrv.LogSubsystems = 1
sqlsrv.LogSeverity = 1
sqlsrv.WarningReturnAsErrors = 0
Restarted the Apache server
But, see phpinfo() output it doesn't have sqlserv in it http://bit.ly/TkMC6V
Just so you know, I am developing this on my windows machine by installing EasyPHP. This website will be deployed on a Unix box. I tried to connect sql server through php on both Windows and Unix machine without any success.
Version info:
SQL Server 9.0.5000
PHP ver 5.4.6
Apache 2.4
I just dont get sqlsrv in my phpinfo() as mentioned in this question PHP Fatal error: Call to undefined function mssql_connect()
Is there a different way to install the drivers, other than what I have outlined above?
Let me know if you need more info.
Thanks!
I found the issue, by looking at phpInfo() output carefully
Loaded Configuration File C:\Program Files (x86)\EasyPHP-12.1\apache\php.ini
I was modifying php.ini in php directory.
But, I needed to modify the one in apache directory
I can delete this silly question.
But, I think it might be helpful for someone facing similar issue.
Jeez , I spent 4 hour on this stupid issue. :)