tags:

views:

61

answers:

2

What's happening with the PHP distribution on Windows?

I installed 4 different versions using default settings and none of them worked, at all.

Two of them complained about missing OCI.dll and the other one about missing zlib.dll.

This is a Windows 7 x64 machine and PHP directory was in PATH as requested - I double checked.

The fun part is that http://windows.php.net even have a qa section but none of the builds that are on the front-page is working and they are supposed to being passed the QA stage :p

PS. Please do not ask why I am trying to use it on Windows, is only for scientific purposes ;)

A: 

You could use something like WAMP

Phill Pafford
Thanks, but I want only PHP, not the entire cow.
Sorin Sbarnea
+1  A: 

If i remember well the problem is that basically all extensions are enabled by default after the install if you do nothing, even theses needing proprietary dlls (like the pdo oracle one).

If you hand-pick the few extensions that you need most of the time it's either working directly or the dlls to use are pretty simple to find.

On my win7 x64 the following extensions are commented in my php.ini and i commented only the one that didn't want to load :

;extension=php_dbase.dll
;extension=php_fdf.dll
;extension=php_gmp.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_ming.dll
;extension=php_oci8.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_oci8.dll
;extension=php_pdo_sqlite.dll
;extension=php_pdo_sqlite_external.dll
;extension=php_pspell.dll
;extension=php_sqlite.dll
;extension=php_sybase_ct.dll

They are at the end of the file in lot of small ini sections.

Placing it in path is not necessary at all (and have never been necessary in fact, it's just easier now), a correct install could be done properly in Program Files as most software.


Or as you said in your comment you could use a version of php working with IIS directly pre-packaged like the one from microsoft. But i personally prefer to keep apache even on windows to be able to use mod_rewrite and .htaccess files (as my final target is an apache install under linux)

VirtualBlackFox
Didn't they learn to check existence of required libraries and skip the extension loading if they do not exist? I suppose not, because currently PHP will just crash.
Sorin Sbarnea
BTW, I removed *all* files from extensions and it still crashes. I don't ever remember having an experience like this with Python or Ruby.
Sorin Sbarnea
The problem is that when you use static linking of a library on windows and such a library doesn't exists your dll entry point is not even called. And checking this from an outside program mean reading the PE header witch is not a simple solution, especially for a platform that no php core developer care about i guess.
VirtualBlackFox
Don't remove file from extensions btw edit your php.ini and remove extension= parts
VirtualBlackFox
Thanks but I found a better solution that worked without any post-installation work http://www.microsoft.com/web/platform/phponwindows.aspx - add this to the from of your solution and I will accept your response.
Sorin Sbarnea