My remark regarding the choice to post in this thread or in a new one was mostly for me - I do prefer clean threads for releases, and quick & dirty but throwable thread for specific (and time limited) issue, but this is *my* preference only, I didn't say I'm right.
that said. my list of questions wasn't there to overwhelm you but really to try to understand the issue since there are several contradictory points.
you're right to explain what you tried (and readers will expect that indeed you did some tries) but please do not try all and every things, a collection of failures is not that helpful.
<<i don't have apache installed. do i need to? like i have said alot of times now i have iss 7.5 with php manager installed. sql 2008r2>>
ok, it wasn't that clear (neither) because of the previous statement: <<You must have the php_mssql library for Apache installed ...>>.
so if you're using IIS (Internet Information Services, not ISS), you shall use the PHP preprocessor compiled with VC9 - yeah who give a sheet about the used compiler, the issue comes from the runtime of the MS compilers; simply consider that this version is the right one.
* installation of PHP over IIS 7+
I won't copy all details, the full installation is
[Only registered and activated users can see links. Click Here To Register...]
- note you will need the
[Only registered and activated users can see links. Click Here To Register...] or the
[Only registered and activated users can see links. Click Here To Register...] w/o install if you prefer. and optionally the
[Only registered and activated users can see links. Click Here To Register...]
I just re-install the whole thing (IIS 5.1 & PHP 5.3.6) from scratch on my XP (I'm using Apache of course) and it requires 5 mn.
Of course, you must test the IIS svr with a dummy index.html page to be sure it works after activating the w3svc service and test the PHP ISAPI module with a dummy index.php file.
Only point that may cause error (on IIS 5.1, not sure about 7) is the "cgi.force_redirect flag in php.ini (it must be set to 0 as indicated in the install page).
* access to MSSQL server
and to MSSQL only ... your previous post listed OCixxx file (for Oracle), sqlite (for SQLite) etc, etc, let focus and what you wanna acheive instead of adding useless stuff, if errors still occur at least they will be relevant for what you are trying to do.
w/o rewriting the full story, accessing to MSSQL (and to MySQL too for some aspects) has always been paintfull because of incomplete package (due to no redistribuable libs or other details).
the good news is that M$ itself does provide an efficient native client to connect to the SQL svr, and this time it's a fully functional package (no missing libs, no boring (.net) overhead)).
[Only registered and activated users can see links. Click Here To Register...] and
[Only registered and activated users can see links. Click Here To Register...].
Execute the downloaded .exe and give the "ext" folder of your PHP install when it prompts you for the target directory.
It copies several files named: php_pdo_sqlsrv_5?_[n]ts_vc?.dll in this folder. There is also a "SQLSRV_Help.chm" file that you will want to put in the middle of your desktop.
So, summary of previous points: we have install PHP 5.*3* and we run IIS (so VC*9*), and we prefer a thread safe ('ts') module, the only module that needed to be loaded thru php.ini is so: php_sqlsrv_53_ts_vc9.dll
in the "Dynamic Extensions" section add:
extension=php_sqlsrv_53_ts_vc9.dll
let all other modules commented - you don't need them.
(php_gd2.dll & php_curl.dll can also be useful but they aren't DB-modules solet forget them right now).
you can also define the full path of your ext directory with the "extension_dir" directive, set it for better reliability, it's suppose to use "./ext" as default, but a guaranty is better.
so, full php.ini settings are:
Code:
[PHP]
;;;;;;;;;;;;;;;;;;;;
; Language Options ;
;;;;;;;;;;;;;;;;;;;;
engine = On
short_open_tag = On
asp_tags = Off
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
doc_root =
user_dir =
extension_dir ="D:\net\php\5.3.6\ext"
cgi.force_redirect = 0
cgi.fix_pathinfo=1
fastcgi.impersonate = 1;
fastcgi.logging = 0
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
extension=php_sqlsrv_53_ts_vc9.dll
(all other options / directives left with their default values)
3 additional mn spent on that install.
* connect to MSSQL
restart IIS to make sure it reloads PHP with the new settings and test dummy connection:
index.php:
Code:
<html>
<head>
<meta HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
</head>
<body>
<h2>Welcome to IIS with PHP and MSSQL **</h2>
<?
$connectionInfo = array(
'UID' => 'Shaiya',
'PWD' => 'Shaiya123',
'Database' => 'PS_UserData'
);
$conn = sqlsrv_connect('127.0.0.1', $connectionInfo);
$smt = 'SELECT UserID FROM Users_Master';
$set = sqlsrv_query($conn, $smt);
echo "<ul>\n";
while ($row = sqlsrv_fetch_array($set)){
echo "<li>$row[0]</li>\n";
}
echo "</ul>\n";
sqlsrv_free_stmt($set);
sqlsrv_close($conn);
?>
</body>
</html>
IIS-based php/mssql server fully functional is less than 10 mn. (functional, i didn't say useful).
Edit: M$SQL 2008 R2 was already installed on the machine - with all dev modules including the support of the native driver - may be you can miss some files at this point (depending of your SQL2k8 install), if it's the case, restart the install wizard & add those modules (mainly the "native driver support").
* checking libs
if at one point, you have a "Unable to load dynamic library 'foo.dll'" message; as indicated in my previous post, when a lib failed to load, it is *not* in 99% of cases because it isn't present in the given directory - "i have manualy search'ed for them and they are all there." is a
bad response (unless you deliberately do stupid things of course)
but it's because the lib relies on other libs that can not be found in the scanned dir. (system, env. path, ...)
so
[Only registered and activated users can see links. Click Here To Register...], download it, unzip in your \dev\bin\tools favorite folder and drag the lib that refuses to load on it, you will know which (other) dll is missing, then u will google it or check your install to figure out a mispelled directory name or config file.