We're trying to set up a work environment using the following specs:
Symfony 2.3.4
MS SQL Server 2008
PHP 5.5.6, x86, thread safe
SQLSRV PDO drivers for PHP 5.5
Windows 7 x64
XAMPP 1.8.3, Apache is x86
SQL Server 2012 Native Client, x64 (x86 could not be installed)
Visual C++ (can't remember the version) x86 and x64
However, when we try to make a query to the database, we get a "could not find driver" error and no operation can be done. In the phpinfo() I can see the drivers are not registered properly and I get two errors when Apache loads, but none has a message and in the PHP logs the error is "unknown" at line 0.
What could be the problem? Thank you beforehand.
The issue was that I didn't have the Visual C++ Redistributable package. I realized this after rebooting the computer and getting a MSVCP110.dll missing error in a system dialog box rather than a dialog box from XAMPP.
If anyone else is having this very same issue, download Visual C++ Redistributable for Visual Studio 2012 Update 4 here, in the Microsoft website. Although the computer works with a x64 architecture, I downloaded the x86 version and it worked. Make your choice but I'd recommend doing the same, because PHP is x86 only (x64 is merely experimental and the drivers are x86 aswell).
Related
I am trying to use the Microsoft SQL Server drivers with PHP 7.1 Not Thread Safe x64 on Windows 2012 R2 64-bit server.
No matter what I do I am getting an error when I run php from a admin command prompt
Warning: PHP Startup: Unable to load dynamic library
'ext\php_pdo_sqlsrv_7_nts.dll' - The specified procedure could not be
found.
Additionally it display a windows pop up that states
The procedure entry point call_user_function could not be located in
the dynamic link library C:\PHP7\ext\php_pdo_dqlsrv7_nts_x64.dll
I have verified that the php.ini is pointing to a file that exists, because if I rename the .dll file, the error messages changes to "specified module could not be found", instead of specified procedure.
I have installed Microsoft Visual C++ runtime 15 x64 as required by PHP 7.
I have installed Microsoft ODBC driver 13 as required by the Microsoft SQL Server driver.
I have rebooted the server twice.
There is nothing else I can think to even try. The Microsoft WinCache.dll is loading and working fine in PHP, as verified by phpinfo.
Confirmed what #MEmerson said above. You need to downgrade PHP to 7.0.X(?) - I used 7.0.12.
Complete Setup:
Windows 10 Pro
PHP X64 7.0.12 TS (Bitnami WAMP Stack)
Microsoft ODBC Driver 13.1 for SQL Server (https://msdn.microsoft.com/en-us/library/mt703139(v=sql.1).aspx)
Microsoft Drivers for PHP for SQL Server 4.0 (https://www.microsoft.com/en-ca/download/details.aspx?id=20098)
Same drivers with PHP X64 7.1.0 produced the error you are getting.
Microsoft Drivers 4.3 for PHP for SQL Server are now available.
These drivers contains files for PHP 7.1 - php_pdo_sqlsrv_71_nts_x64.dll etc.
I've successfully managed to connect to SQL server.
Had similar error when tried to use httpd (Apache), PHP 7.2.2, Microsoft ODBC driver 11 on MS Windows Server 2012. The text of error was:
The procedure entry point call_user_function could not be located in the dynamic link library php_pdo_sqlsrv_7_ts_x64.dll.
when I called php -m to check modules.
So I have downloaded Windows-7.2.zip from https://github.com/Microsoft/msphpsql/releases and used thread-safe dlls from it.
php -m works now as it should without giving error.
Same as NoCopy
Windows Server 2012
php-7.0.15-Win32-VC14-x64.zip from (http://windows.php.net/download)
Visual C++ Redistributable for Visual Studio 2015 (https://www.microsoft.com/en-us/download/details.aspx?id=48145)
Microsoft ODBC Driver 13.1 for SQL Server
Microsoft Drivers for PHP for SQL Server 4.0
7.1.x still a No,NO from Microsoft
It happened to me today while enabling the extensions in the IIS, where I by mistake enabled different versions for pdo & driver extensions (E.g. php_sqlsrv_7_nts_x86.dll for PHP 7.0 & php_pdo_sqlsrv_72_nts_x86.dll for PHP 7.2).
Usually the package that you download from Microsoft that contains Microsoft Drivers 5.3 for PHP for SQL Server has all the PHP extensions versions. https://www.microsoft.com/en-us/download/details.aspx?id=57163
Just make sure you enable both extensions for the same versions to avoid that error.
I have installed WampServer 2.2 on Windows 8.1.
When I try to start WampServer, it shows the following error:
The program can't start because MVSCR110.dll is missing from your computer.
How can I fix this?
MVSCR110.dll references to the Visual C++ 2012 Redistributable, of which you do not have.
The Visual C++ 2012 Redistributable is required for Apache to run. The reason why your Wamp installation is not going online is because Apache is unable to start.
A forum post on the WAMP Server forums deals with this problem with an earlier version of Wamp, to quote:
For Windows 32 : Be sure that you have installed the Visual C++ 2012
SP1 Redistributable Package x86 : VC12 SP1 vcredist_x86.exe
For Windows 64 : Be sure that you have installed the Visual C++ 2012
SP1 Redistributable Package x64 : VC12 SP1 vcredist_x64.exe
Apache will not run without this component
In fact if you are running the 64bit Windows it is a good idea to
install all the 32bit libraries as well as the 64bit ones. After all
64bit windows runs 64 and 32 bit code. You will probably find you need
at least one of the 32bit runtimes for some app/utility you will
install at some point.
Some users have also said that installing the Redistributable for their processor type isn't enough, so it may be a good idea to install both x64 and x86 versions.
WampServer versions b and later require the VC++ 2012 version, which can be downloaded here.
As far as I remember Windows 8.1 comes (out of the box, so to speak) with only one of Microsofts Visual C++ runtimes installed.
It seems a little odd that you are getting the message you claim if you are in fact using WAMPServer 2.2(a,c,d,or e)
The program can't start because MVSCR110.dll is missing from your
computer.
As as far as I am aware nothing delivered by any of the WAMPServer 2.2 releases i.e. 2.2a, 2.2c, 2.2d, 2.2e were compiled with MSVC 2012. In fact as stated on the download pages on SourceForge
Attention : All the components of the v2.2 WampServer stack have been compiled with VC9 version of Microsoft compiler. Earlier versions of Wampserver have been made with VC6 version of Microsoft compiler. So, You can't mix components of 2.2 stack with previous version of Wampserver Stack components. If you do it you will get an instable Wampserver.
However, if that is in fact the error you are getting after installing WAMPServer 2.2, then that message is saying that you need to install the MSVC 2012 runtime library.
Which can be downloaded from here.
You will also need to make sure that you have the MSVC 2008 runtime library installed as well, as wampmanager.exe is an old program as has not needed to be recompiled for a while now which can be downloaded from here
This runtime will also be required to run Apache and MySQL executables if you did in fact install WAMPServer 2.2.something
Oh and if you are using a 64bit WAMPServer, you will need to download and install the 32bit AND the 64bit version of the MSVC 2008 runtime library, as wampmanager.exe is a 32bit program even if you have installed the 64bit version of WAMPServer and of course the Apache and MySQL will need the 64bit libraries.
If this does not fix your issue, then have a look at the Windows Event Log
Windows Key + R to launch the run dialog then enter eventvwr.exe and press the OK button
- On the left side of the windows click 'Windows Logs -> Applications'
- Look for the names 'Apache' or 'MySQL' in the 'Source' column which have a error symbol in the first column.
The error messages sent here are normally very descriptive and should at least point you in the right direction to solving your problem.
when you migrate to windows 8.1, MVSCR110.dll is outdated. then, it should be updated and installed into your PC again.
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.
Similar questions seem to be all over the internet, but so far nothing has helped.
I'm currently running WampServer with Apache 2.4.4 and PHP 5.4.12 on Windows Server 2008 R2. According to the PHP documentation the drivers necessary to connect to an MSSQL server ship with the distribution; they do not. Neither php_mssql.dll (which the documentation claims is no longer necessary for PHP5.4, but which is still referenced in php.ini. Who knows) nor php_pdo_mssql.dll are present in the distribution.
Several sources pointed to these drivers from Microsoft, however I had no success either renaming the respective drivers to php_mssql.dll/php_pdo_mssql.dll or keeping the names the same (php_sqlsrv_54_nts.dll, php_pdo_sqlsrv_54_ts.dll, etc.) and modifying php.ini to point to the proper driver. Though I didn't get an error upon starting apache as I do when the driver is simply missing, I received Error!: could not find driver when attempting to point to a test php page at localhost.
This article seemed the most promising, but unfortunately ntwdblib.dll is not included in the zip distributions of PHP, contrary to what the article claims. This seems like it should be a laughably simple problem: missing drivers, which are supposedly readily available. And yet here I am... What am I doing wrong?
In case anyone else ends up here while trying to solve this problem, here are the steps that have worked for me the two times I've done it. These steps worked both on Windows Server 2008 R2 and Windows 8.
For my purposes, I used the latest 32-bit (x86) version of WampServer (at the time of this writing, it was 2.4, and came with Apache 2.4.4 and PHP 5.4.16). The 32-bit version is necessary, as the drivers are 32-bit; the 64-bit version will not work.
Install Microsoft Visual C++ 2010 Redistributable Package x86
Install Microsoft SQL Server 2008 Native Client x86 (Click "Download" and select ENU\x86\sqlncli.msi. Once again, the 64-bit version will not work)
Install Microsoft ODBC Driver 11 x86 (Click "Download" and select 1033\x86\msodbcsql.msi)
Install Microsoft SQLSRV driver 3.0 in php/ext/ (For my installation, this was C:/wamp/bin/php/php5.4.16/ext/)
Edit Apache's php.ini to include the line extension=php_pdo_sqlsrv_54_ts.dll (for my installation, this was located in C:/wamp/bin/apache/Apache2.4.4/bin/)
You have to place the file in the directory for PHP/ext (bin/php/ext depending on your Wamp / Xampp installation). However, you also need the SQL server native client as per: http://msdn.microsoft.com/en-us/library/cc296170.aspx
I am trying to install PHP 5 on a Windows Server 2003 environment with IIS 6
After installing PHP, and making the necessary changes in IIS, I get the following error
%1 is not a valid Win32 application.
The server is not 64bit, it is 32bit. I have added the FastCGI
handler in Web Service Extensions,
I have added the PHP handler in
Web Service Extensions, I have also gone to "Web Sites Properties"
and clicked on Configuration: and set the appropriate mappings,
I've installed the reditrubition files as required by Microsoft...
I cannot for the life of me work out why it is not working.
Can someone please help?!
Finally got my installation working by installing the correct corresponding versions and dependencies. I hope this helps.
On IIS 6
PHP 5.4
VC9 x86 or x64
WinCache 1.3 for PHP 5.4
On IIS 7
PHP 5.5
VC11 x86 or x64
WinCache 1.3 for PHP 5.5
Try running PHP directly from command line to see if you receive the same error. If it is, the issue may be that a dependency cannot be found. PHP has a dependency on the Visual C++ Redistributable - from http://windows.php.net/download/ :
The VC9 builds require you to have the Visual C++ Redistributable for Visual Studio 2008 SP1 x86 or x64 installed.
The VC11 builds require to have the Visual C++ Redistributable for Visual Studio 2012 x86 or x64 installed.
if this doesn't help, run the Microsoft utility Depends.exe from http://www.dependencywalker.com/ to find out what might be the issue.
in System Properties > Environment Variables click on new in variable name = path and variable value = C:\wamp\bin\php\php5.3.13; and click on ok > ok > ok
click on run type cmd
in cmd type php
if you get up error in cmd type cd c:\ and enter now type php
I have faced the same issue on standalone Apache+PHP setup on Windows 10. Definitely the problem was in two different PHPs in the environment variable PATH (IIS distro and standalone distro). Removing the PHP for IIS from the PATH resolved the problem.
Unfortunately PHP only goes as far as 5.4 on Windows 2003. They officially dropped support for Windows XP and 2003 starting PHP 5.5.0.
http://windows.php.net
Here you can find PHP for older Windows systems: PHP 5.5.7, 5.4.23, 5.3.28 (x86/x64) available
Following binaries are available:
php-5.5.7-nts-Win32-VC11-x86.zip
php-5.5.7-Win32-VC11-x86.zip
php-5.5.7-nts-Win32-VC11-x64.zip
php-5.5.7-Win32-VC11-x64.zip
php-5.4.23-nts-Win32-VC9-x86.zip
php-5.4.23-Win32-VC9-x86.zip
php-5.4.23-nts-Win32-VC9-x64.zip
php-5.4.23-Win32-VC9-x64.zip
php-5.3.28-nts-Win32-VC9-x86.zip
php-5.3.28-Win32-VC9-x86.zip
php-5.3.28-nts-Win32-VC9-x64.zip
php-5.3.28-Win32-VC9-x64.zip
For "FastCGI" on Windows Server 2003, you should choose php-5.4.23-nts-Win32-VC9-x86.zip.