I have installed AppServ 2.6.0 on Windows 2008 R2 but when I go to localhost/phpinfo.php I don't see mysql in there. I see "mysqlnd" I don't know what this is but it is there.
Moreover, Where i go to localhost/phpmyadmin I get an error in red
phpMyAdmin - Error
Fatal error: Call to undefined function get_magic_quotes_gpc() in C:\AppServ\www\phpMyAdmin\error.php on line 63
Please note that I have installed Innodb during the installation of AppServ 2.6.0.
What is wrong with this? why MySQL is not working? I have been working on this for couple of days so I aprechiate any help
According to this post: Using get_magic_quotes_gpc on PHP Version 5.2.14 or equivalent for PHP Version 6
get_magic_quotes_gpc has been completely removed in PHP 6.
It has been deprecated since PHP 5.4 according to this: http://php.net/manual/en/function.get-magic-quotes-gpc.php
As for MySQL, I'm not too familiar with AppServ, but do you need to enable the mysql modules in the php.ini? Also, can you connect to mysql from the command line tool?
Related
I have installed:
Windows Server 2008 R2 x64
IIS 7
PHP 5.5 (5.5.9) VC11 x64 Non Thread Safe (2014-Feb-06 00:36:15)
MSVC11 (Visual C++ 2012)
Sql Server 2008
Sql Native Client
Everything works perfectly except the MSSQL driver for PHP. I have Googled a lot and downloaded lots of dll files. Every time I get this error:
PHP Warning: PHP Startup: Unable to load dynamic library c:\php\ext\php_sqlsrv_54_nts.dll - %1 is not a valid Win32 application.
in Unknown on line 0
Can anyone tell me that how can I find the specified driver? Thanks in advance.
There's a clue in the file name php_sqlsrv_54_nts.dll
The "54" refers to PHP 5.4. The SQL Driver doesn't (officially) exist yet for PHP 5.5.
:(
Some people have worked on unofficial builds, but I would only use them for local testing.
Microsoft sqlsrv extension for php 5.5.x
At present official releases only work with 5.4.x
Here is a page from my blog with instructions on how to install the driver: http://robsphp.blogspot.com/2012/09/how-to-install-microsofts-sql-server.html
Look for text written in in orange which refers to my builds of the driver that support PHP 5.5 32 and 64 bit.
If you only want Microsoft's builds, avoid looking at anything written in orange.
Sharing some of my findings:
Architecture matters(x86 / x64)
PHP version matters a lot
Matching SQL Driver Should be installed.
Refer This Link to find whether your PHP version supports the driver (Refer the first table).
Refer Rob's Answer to find your Architecture and TS/NTS (Thread Safe/Non Thread Safe) of Your PHP This is His Blog
This is what worked out for me: I tried with Wampp - 64bit, Selected PHP 7.0.10 downloaded MYSQL Driver version 5.3 (Note: Refer the table i mentioned- 4th point to get the correct version)
Saved only the 64 bit TS (php_sqlsrv_7_ts_x64.dll, php_pdo_sqlsrv_7_ts_x64.dll) because my php was Thread Safe (You can find yours by refering 5th point) into the E:\wamp64\bin\php\php7.0.10\ext folder.
Added extension=php_sqlsrv_7_ts_x64.dll and extension=php_pdo_sqlsrv_7_ts_x64.dll to the php.ini, selected from wampp menu (E:\wamp64\bin\apache\apache2.4.23\bin\php.ini).
Restarted Wampp, and it works perfect.
For those who face call to undefined function sqlsrv_connect() also can follow this technique.
I am working on a Windows 7(x64) with Apache 2.4 x86, Php54 x86
and MySql 5.6 x64.
PHP is working well on my Apache Web Server.
When i run PHP from CommandLine : php dbTest.php it runs without problems
but when i try to load my page, i get the error Fatal error: Call to undefined function mysqli_connect() in <path to dbtest.php> on line 3
tried installing PHP 55 but nothin...
Tried putting libmysql.dll in (php dir, win/system32, apache bin)
installed VC71 runtimes (because i saw it in a troubleshooting guide)
Edit:
- also tried installing all x64 (Apache and PHP)
- tried to install Apache v2.2 and PHP v5.3,
Nothing works...
how come running the command-line works but through Apache, it isn't working?
i see mysqlnd listed, but not mysql/mysqli, as if mysqlnd was the module...
Thank you for your time.
and for saving me the last few hair i have!
PHP 5.4 comes with mysqlnd installed by default so you shouldn't need libmysqli.dll
Does phpinfo() list a mysqli block?
You need this file in ext directory php_mysqli.dll
Am using windows 8 pro, Wamp server (php V5.3.5, apache V2.2.17), Sql server 2005 express editon. I have downloaded the sqlsrv drivers and extracted them into the php extention folder (C:\wamp\bin\php\php5.3.5\ext), have also update the php.ini file by adding the extentions
extension=php_sqlsrv_53_ts_vc6.dll
extension=php_pdo_sqlsrv_53_ts_vc6.dll
I used this two after series of try and error on all the dll file, it was this two that come up with no error, when restarting the wamp server
This is the connection line of code;
$con = sqlsrv_connect('TAQUATECH\SQLEXPRESS') or die("cannot connect");
It came up with the following error;
Fatal error: Call to undefined function sqlsrv_connect() in
C:\wamp\www\Webs\client.php on line 7
pls, i need somebody to help me on this, i will really appreciate
Sorry if too late to answer, but I had the same error, and I found out that Wamp Server 64bit does not support SQL Server Connection, you must install a 32bit version of wamp server.
For those using 64-bit systems (OS, WAMP, MSSQL), these 64-bit drivers can serve them and fix the error:
Fatal error: Call to undefined function sqlsrv_connect() in C:\wamp\www...
Drivers SQLSRV x64:
http://robsphp.blogspot.in/2012/06/unofficial-microsoft-sql-server-driver.html
You'll need to install and enable sqlsrv on your web server. Have a look at the installation page on the official PHP website.
Installation of Microsoft Drivers 3.0 for PHP for SQL Server will fix this issue. Also try this PHP Manual.
EDIT :
The most recent version of the driver is available for download here:
» SQLSRV 3.0 download. If you need support for PHP 5.2 and/or PHP
compiled with VC6, use the 2.0 release of the driver: » SQLSRV 2.0
download.
Source
Yap, I have gotten a work-around;
The problem was, running the php script using apache server on my system, I stoped the wamp server and configure fastCGI for PHP using IIS 7, You can get a video tutorial Here
http://www.iis.net/learn/application-frameworks/running-php-applications-on-iis/set-up-fastcgi-for-php.
It simple and nice, now i can connect to both sql server 2005 and 2008
My PHP Details
Version => 5.3.5
Compiler => MSVC6 (Visual C++ 6.0)
SqlSrv Driver => php_sqlsrv_53_ts_vc6.dll
use 32 bit PHP Version.
enable below one of them in php.ini
[PHP_PDO_SQLSRV_53_NTS]
extension=php_pdo_sqlsrv_53_nts.dll
[PHP_SQLSRV_54_NTS]
extension=php_sqlsrv_54_nts.dll
[PHP_SQLSRV_53_NTS]
extension=php_sqlsrv_53_nts.dll
[PHP_PDO_SQLSRV_54_NTS]
extension=php_pdo_sqlsrv_54_nts.dll
thease dll version you can downlowd online
I am trying to update my PHP, MSSQL functions to the newer ones which are supported by PHP 5.4. I have done everything and searched everywhere but I just can't get it to work.
I have installed WampServer 32 Bit to my C: drive and I have installed SQL drivers for PHP. I have made sure that the package I chose was 3.0 (http://www.microsoft.com/en-gb/download/details.aspx?id=20098) and I installed them correctly. I put the 'php_sqlsrv_54_ts.dll' into the ext folder which is in wamp/bin/php/ext and I added the 'extension=php_sqlsrv_54_ts.dll' to the php.ini file which is in wamp/bin/php.
Next I started all the services successfully and then went to my local host to find out that I was receiving this error:
Call to undefined function sqlsrv_connect() in C:\wamp\www\launcher\Login2.php on line 11
Further Information:
Running Windows 7 SP1 Ultimate 64 bit
Download Wamp Server 2 for 32 Bit
Apache : 2.4.4
MySQL : 5.6.12
PHP : 5.4.16
PHPMyAdmin : 4.0.4
SqlBuddy : 1.3.3
XDebug : 2.2.3
Running it on my localhost/127.0.0.1
Using port 8080 in Apache
Enabled pdo extensions in php.
Using the php_sqlsrv_54_ts.dll
Restarted Wamp several times.
I fixed it. I had previously gone into PHP extension via wamp server controls and ticked php_pdo_mssql and php_mssql but now that I have unchecked these I don't get the error anymore but rather a database connect fail. I am not familiar with the new sql server connections. Before I used mssql_connect with my host being as 'Farbod-PC\SQLExpress' I still use this host and it works fine.
after spending 7 hours on it, this was the answer to connect PHP 5.4 to MS SQL server.
edit: or just use php 5.3, as that has native php mssql connectors
I'm working on a project that uses the SQL Server Driver for PHP, and want to upgrade the driver to the new version (2.0), because I need some of the functions that have been implemented there.
I replaced the old .dll in the php/ext directory and restarted the web server. But now I receive the following error:
Fatal error: Call to undefined function sqlsrv_connect() in E:\ProjekteExtern\hades\_apl\classes\sql\sqlsrv.class.php on line 34
The phpinfo() output shows sqlsrv, just like with the previous version.
Does anybody know why I'm getting this error or have any ideas to solve this problem?
For those still having errors with PHP and Microsoft SQL Server using PHP SQL, check the web server's log (Apache, IIS, etc). I have just found out that WampServer x64 is not compatible with PHP SQL Server Driver, so I'm installing the 32-bit version back again.
UPDATE:
for WampServer 2.2, PHP is compiled thread-safe and with VC++ 9.0, so it works using either
php_pdo_sqlsrv_53_ts_vc9.dll
or
php_sqlsrv_53_ts_vc9.dll