extension=php_mssql.dll - error load - php

I am configuring a server IIS7 to work with php and mssql in php.ini and when I try to call the "extension = php_mssql.dll" appears to me an error when I refresh the site.
"500 - Internal server error.
There is a problem with the resource you are looking for, and it can not be displayed. "
Thanks

The php_mssql.dll is missing the latest 5.3 releases because support for this extension has been dropped. Version 5.3.1 stills has a version which you can also use in 5.3.5. Just copy it to the ext dir.

You don't mention your PHP version, but here's a relevant article that suggests two DLLs that may be missing:
http://forums.iis.net/t/1164387.aspx
But note that the key message of the article is that php_mssql.dll depends on an old MSSQL driver that's no longer supported, so moving to the new Microsoft PHP MSSQL driver seems to be a good idea.

Related

SQL server extension not working in PHP v7.4.8

So I was updating our web servers (Windows 2012 R2/IIS) with the newest version of PHP this morning (version 7.4.8 from 7.4.6, because I was slacking 2 weeks ago).
In our setup, we include the dll from Microsoft (php_pdo_sqlsrv_74_nts.dll) in the ext folder as we have some sites running some PDO lookups to some backend SQL servers. After I registered the new version, I started getting errors in those PDO calls (PDO is loading), but I'm getting cannot find driver. As soon as I switch back over to 7.4.6, everything loads.
I didn't see a newer file provided from Microsoft yet. Is anyone else seeing this behavior or have a fix for it yet?
Thanks,
Since I had more then one php version installation.I had to specify the specific extension folder in my php7.4.8 ini file. i.e.extension_dir = "C:/php7.4/ext"
Everything worked fine after that
Since there could be multiple PHP version side-by-side.
1.Please ensure your IIS PHP-CGI handler is pointing to the right version.
2.Please ensure you have copy the dll to the right ext folder
3.Please ensure you have set the correct extension_dir
4.Please ensure you have registered the extension=..... correctly.
5.Please do an IISRESET when you finish updating the configuration.
You can try to double click php-cgi.exe to check the real exception. If everything is set correctly, there might be some compatibility issue.
Have you tried to double click php-cgi.exe to check the real
exception? If there is a issue, there should be an error message. Have
you encountered any error message?
No error after double clicking php-cgi.exe
So this was eventually fixed in the release of 7.4.10. It was a little known error it seems, but they got it fixed.

Xampp MS SQL server PHP 5.6

I have a xampp running with PHP 5.6. Normally I use mysql server, but for a script that already exists i need a MS SQL server.
I searched on the net and installed SQL server 2012.
But now I need the drivers for PHP. Unfornunately I can only find a version that supports 5.4, 5.5..
(http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx)
Is there a way to let this work with 5.6?
Microsoft recently released a new version (3.2) of the SQL Drivers for PHP which includes compatibility with PHP 5.6.
You can download the drivers here: https://www.microsoft.com/en-us/download/details.aspx?id=20098
I searched the net for a while.. After posting this question for 10m, I finally found a unofficial driver..
Hope this works, I will check this out..
You can find it on: http://robsphp.blogspot.be/2012/06/unofficial-microsoft-sql-server-driver.html
I believe it's time to revisit this answer a bit better.
Since you've been pretty clear with your setup. The short answer is placed as steps below
Download ver 3.2 of the SQLSRV drivers from here.
https://www.microsoft.com/download/details.aspx?id=20098
Do extract them to your "xampp installation path"\php\ext
Kindly ensure you see and keep the files : php_sqlsrv_56_ts.dll and php_pdo_sqlsrv_56_ts.dll
Please delete the redundant files below:
PHP Drivers License Terms.rtf,
php_pdo_sqlsrv_54_nts.dll,
php_pdo_sqlsrv_54_ts.dll,
php_pdo_sqlsrv_55_nts.dll,
php_pdo_sqlsrv_55_ts.dll,
php_pdo_sqlsrv_56_nts.dll,
php_sqlsrv_54_nts.dll,
php_sqlsrv_54_ts.dll,
php_sqlsrv_55_nts.dll,
php_sqlsrv_55_ts.dll,
php_sqlsrv_56_nts.dll,
release.txt,
SQLSRV_Readme.htm,
SQLSRV_ThirdPartyNotices.rtf,
Place these lines in your php.ini at your "xampp installation path"\php\php.ini
extension=php_sqlsrv_56_ts.dll
extension=php_pdo_sqlsrv_56_ts.dll
Restart your XAMPP server and place a '<'?php phpinfo(); ?'>' in an index.php file at \htdocs\'folder'
Navigate to it using http://localhost/'folder where phpinfofile is placed'/index.php
If you see something like this image below. It's done, Congratulations]1
PS : The long answer is here.
https://msdn.microsoft.com/en-us/library/cc296170.aspx
At this time:
My solution was:
1- Download ver 3.2 of the SQLSRV drivers from here. https://www.microsoft.com/download/details.aspx?id=20098
2 Extract the files to your "xampp" folder into the \php\ext
3- Add this lines to php.ini
extension=php_pdo_sqlsrv_56_ts.dll
extension=php_pdo_sqlsrv_56_nts.dll
extension=php_sqlsrv_56_ts.dll
extension=php_sqlsrv_56_nts.dll

How can I use mssql functions on php? I don't have php_mssql.dll in my extensions folder

I'm trying to use SQL Server with PHP but I don't know how to install this feature. I have enabled extension=php_mssql.dll in my php.ini file but after restarting apache I got a error message saying that don't found the DLL file.
After much attempts I reinstalled XAMPP 1.81, and I'm starting now from zero.
Thanks for any help.
Edit MSSQL has been discontinued as of 5.3
I believe the correct driver is php_sqlsrv.dll.
http://www.php.net/manual/en/sqlsrv.installation.php
Here are the available functions: http://www.php.net/manual/en/ref.sqlsrv.php

Class 'Memcache' not found & PHP

I installed memcached by reading this article on Windows7 but unfortunately i keep getting error Fatal error: Class 'Memcache' not found in D:\xampp\htdocs\test\memcache\test.php on line 2
Line 2: $memcache = new Memcache;
Win7 64, Xampp Installed. I am using net start "memcached Server" on command line but it says service is already started.
Some other info which may help;
On php.ini file:
extension=php_memcache.dll
[Memcache]
memcache.allow_failover = 1
memcache.max_failover_attempts=20
memcache.chunk_size =8192
memcache.default_port = 11211
Update: phpinfo(); show dll is not loaded. Tried several different dll files so far, didn't work. Also dll is located correct. It is in the right folder as it seems.
(P.S. Some may think there are possible duplicates about this topic but there is only 1 person who followed the same instructions and had same error in SO. That question has no answer or solution since march.)
I found the working dll files for PHP 5.4.4
I don't knowhow stable they are but they work for sure. Credits goes to this link.
http://x32.elijst.nl/php_memcache-5.4-nts-vc9-x86.zip
http://x32.elijst.nl/php_memcache-5.4-vc9-x86.zip
It is the 2.2.5.0 version, I noticed after compiling it (for PHP
5.4.4).
Please note that it is not 2.2.6 but works. I also mirrored them in my own FTP.
Mirror links:
http://mustafabugra.com/resim/php_memcache-5.4-vc9-x86.zip
http://mustafabugra.com/resim/php_memcache-5.4-nts-vc9-x86.zip
Add this to your php.ini:
extension="php_memcache.dll"
and restart apache
Memcached just uses standard text interface so its possible to use it without the module.
// connect
$link = fsockopen($host,$port,$errno,$errst,$timeout);
// set
$data = sprintf("set %s 0 %s %s\r\n%s\r\n",
$key,$expire,strlen($value),$value);
fwrite($link,$data);
$result = trim(fgets($link));
if ($result == 'ERROR') {
// :(
}
// get
$data = sprintf("get %s\r\n",$key);
fwrite($link,$data);
$line = rtrim(fgets($link));
if ($line != 'END') {
return rtrim(fgets($link));
}
So i have looked now for a solution. Here you can download some compiled extensions.
http://downloads.php.net/pierre/
The problem is that at the moment there is no memcache extension for PHP 5.4. this is the problem why your extension could not be loaded. You need the extension for the correct PHP version and Tead Safe for Windows.
So the easiest way is to work with PHP 5.3 if you need the extension.
The newest version of memcache is the version 3.0.6 but its a beta version you can see it here.
http://pecl.php.net/package/memcache
You could try to take the beta version and compile it with your windows system. But its a lot of work.
Also problem can be in loading another version of php module somewhere in apache .conf files. Need to check duplicated "LoadModule php..." directives and if that module compiled to correct version of apache.
It seems sound simply, but not when you have several versions of php on one machine :)
Or it can be SElinux problem too.
xampp windows version is 32bit ,you must be use 32bit memcache.dll
I hole that would be useful for you!

Call to undefined function sqlite_escape_string()

i am using sqlite_escape_string($str) to prepare sql statements for future use.
however, when i migrated my code to a new server, it says:
Call to undefined function sqlite_escape_string()
seems the Sqlite and everything is working in the new server, but i have error even for a sqlite_open().
Anyways, i just need to escape my $str to a sqlite safe sql statments, i dun even need to write to sqlite from PHP, so an
That sounds like the SQLite plugin is not enabled for PHP. Write <?=phpinfo()?> in a .php file, load it up on your server and see if SQLite is mentioned in the loaded plugins.
You need to uncomment the extension=php_sqlite.dll line by removing the semi colon right now your pdo_sqlite is enabled and sqlite_escape_string is a function of sqlite extension and sqlite_pdo will not work untill php_sqlite is enabled
I found the ans myself.
It is due to my server is a Centos 5.4, and sqlite support for php is not there.
The same case should exist in REL5 also.
see the 1st and 2nd latest comment in the link below:
http://www.php.net/manual/en/sqlite.installation.php
I solved it by recompiling my php and added the sqlite.ini file
For those who recently upgraded to 5.4+, note that the php docs say, this method is not available 5.4+
(PHP 5 < 5.4.0, PECL sqlite >= 1.0.0)
So you would either need to manually compile it in, or look at PECL.

Categories