php_mcrypt extension for windows server 2008 R2 - php

I found lots of articles about this problem, however none of them helped me.
Here is a I list of what I 've already tried:
uncomment the semicolon on php.ini
add the dependence file (libmcrypt.dll) on php folder, windows and
windows/system32
I 've restarted the IIS Server after each attempt
I cannot use this method, it was installed with a zip file.
On IIS Manager the extension is shown as enabled but checking the php error log I found this message multiple times:
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\PHP\v5.3\ext\php_mcrypt.dll' - %1 is not a valid Win32 application. in Unknown on line 0
Here is a the screenshot of phpinfo()
I have Windows Server 2008 R2 64bit with IIS 7.5 and PHP 5.3.10. Maybe the file (php_mcrytp.dll) is not the good one, where can I download it? On php site I cannot find the php_mcrytp.dll file under ext folder.
Thank you

If you downloaded PHP for Windows from php.net and are running the FastCGI version of PHP (as you should with PHP 5.3.x and IIS), mcrypt library is already compiled statically in the PHP engine. You don't need to install any extra DLL.
If you see the mcrypt section in phpinfo's output then it means mcrypt is already enabled (otherwise the mcrypt section would be missing).
And that's also the reason there is no mcrypt DLL.

Related

OCI8 with PHP7 - module not found

I'm currently setting up a Windows 10 Pro x64 machine to work with Apache, PHP and its oci8 extension.
I successfully managed to get oci8 working on OSX 10.11 and Windows 2012 Server before, so I thought I knew what to do. But this was 32bit – now it's 64.
The software now installed is:
Apache 2.4.18 x64
PHP 7.0.3 TS x64
Oracle Instant Client x64 (instantclient-basic-windows.x64-12.1.0.2.0)
oci8 2.1.0 TS x64
I don't get it to work. The error message is:
Warning: PHP Startup: Unable to load dynamic library
'ext\php_oci8_12c.dll' - Das angegebene Modul wurde nicht gefunden. (Module not found.)
in Unknown on line 0
Extension 'oci8' not present.
I installed the Oracle Instant Client by writing its directory into the PATH variable and copied the php_oci8_12c.dll file to the PHP ext dir and uncommented the corresponding line in the php.ini. Shouldn't that be enough?
I've read many postings here on Stackoverflow and other websites about similar problems, things I've tried:
Moving all DLLs to C:\Windows\system32
Include the PHP extension dir in the PATH variable
Re-checked that every component is 64bit
Created ORACLE_HOME and ORACLE_BASE variables (which shouldn't be necessary)
If I change the php_oci8_12c.dll x64 to the 32bit one, I get a different error message:
Warning: PHP Startup: Unable to load dynamic library 'ext\php_oci8_12c.dll' - %1 ist keine zulässige Win32-Anwendung. (%1 is not a valid Win32 program.)
in Unknown on line 0
Extension 'oci8' not present.
Any ideas what's wrong with all that?
Thank You!
To sum it all up,
One more thing... NTS assumes that PHP does not run as Apache module,
is that correct? Are you using FastCGI? – Álvaro González
was the way to go. If anyone's having troubles with the same, here are the exact steps I took:
PHP 7.0.3 VC14 x64 Thread Safe from windows.php.net/download/
Apache 2.4.18 x64 from apachehaus.com/cgi-bin/download.plx
Oracle Instant Client 12.1.0.2.0 x64 from oracle.com/technetwork/topics/winx64soft-089540.html
(Get the current Thread Safe oci8 DLL from pecl.php.net/package/oci8, but PHP comes with a version of it - worked with either for me)
Install PHP as an Apache module. Unzip the Instant Client and move it to your desired location. Add this location to your PATH system variable. Restart your machine and it should show up under 'PATH' in your phpinfo().
Then I had to make the PHP extension_dir an absolute path. So no 'ext', but 'C:/Program Files/php-7.0.3/ext'. With only 'ext' set to the extension_dir I could connect to a remote Oracle DB via 'php.exe filename.php'. But Apache would throw me an error in error.log that it cannot find the DLL.
No DLL copying is needed if you choose to keep the oci DLL that comes with PHP. No more environment variables than PATH have to be changed/created.
At least in my case :-)

Issue Running Imagick module (PHP 5.3.5, WAMP server 2.1e)

I have installed Wamp server 2.1e-32bit and ImageMagick-6.8.9-7-Q16-x86-dll in Windows Server 2008 R2-x64. After completed my installation process and run wamp server, i get a error message and Imagick not working
The error msg is:
"PHP Warning: PHP Startup: imagick: Unable to initialize module
Module compiled with build ID=API20090626,TS,VC9
PHP compiled with build ID=API20090626,TS,VC6
These options need to match in Unknown on line 0"
How to resolve the problem?
Try the 64-bit DLL since you are running on Windows Server 2008 R2-x64 as recommended by the doc.
UPDATE:
If you don't already have the php_imagick.dll extension, you can download it from here. In your case, you will pick the php 5.3 Thread Safe (TS) x86 version. The caveat here is I am unsure if this will work with the latest imagemagick Q16 DLL.
Copy the php_imagick.dll file to your PHP ext folder, and update your php.ini to include extension=php_imagick.dll. Then restart your WAMP server.
Run phpinfo() to ensure the imagick library is loaded properly.

php_ssh2.dll and PHP 5.5.4 on IIS 7.5

I am trying to get php_ssh2.dll working on my IIS 7.5 server.
I have PHP 5.5.4 installed and running (NTS VC11 x64).
I downloaded php_ssh2.dll from here: http://windows.php.net/downloads/pecl/releases/ssh2/0.12/php_ssh2-0.12-5.5-nts-vc11-x64.zip
I placed the extension and the pdb file in the ext folder of my PHP install and enabled it in IIS.
The problem is when I restart IIS, I get the following in my error log:
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\PHP\5.5.4\ext\php_ssh2.dll' - %1 is not a valid Win32 application. in Unknown on line 0
I also have PHP 5.3 installed with php_ssh2.dll (not the same as linked above) and it works fine.
I do have libssh and openssl installed, as well as Visual C++ 2012 x64.
Is there some other step I'm missing?
Minor update, I tried doing everything above with the x86 builds instead and had the same results. PHP itself runs fine, but I cannot utilize the php_ssh2.dll
It appears the issue is that the 5.5x builds of the php_ssh2.dll lack the libssh2.dll, per this bug report: http://www.phplt.com/2013/09/17/17/php_ssh2-0-12-5-5-nts-vc11-x86-zip-missing-file/
Is this something I can build or acquire elsewhere?
What are you trying to do with php_ssh2.dll? Maybe phpseclib, a pure PHP SSH2 implementation, would work better for you?

PHP loading extensions error

I'm trying to get PHP to load some extensions (sqlsrv driver for PHP PDO).
I'm using a wamp server, With PHP 5.4, Apache 2.4.4.
In my PHP.ini file, i've entered the following line:
extension_dir = C:\wamp\bin\php\php5.4.16\ext
...
extension=php_pdo_sqlsrv_54.nts.dll
However in the apache error log, whenever I restart the apache service, I get the error message:
PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.4.16/ext/php_pdo_sqlsrv_54_nts.dll' - The specified module could not be found.\r\n in Unknown on line 0
Now, I know for a fact, this error is incorrect. If I copy the file location directly from the error log, (C:\wamp\bin\php\php5.4.16\ext\php_pdo_sqlsrv_54_nts.dll) and paste it into windows explorer, it finds the file fine.
I've added the ext directory to windows PATH environment variable, still no success.
Any ideas what to try next?
Thanks
Your problem is that you are trying to run a NTS 'Not Thread Safe' dll with a PHP that is 'Thread Safe', so initially try downloading the Thread Safe version of the sqlsrv DLL.
BIG NOTE and possibly your next problems solution:
As far as I know the sqlserver database interface dlls are only available as 32bit. So if you have installed the 64bit WAMPServer you will have to uninstall and install the 32bit WAMPServer.

PHP Startup: unable to initialize module

i'm trying to install mongoDB in my system. As instructed in
http://www.mongodb.org/display/DOCS/PHP+Language+Center,
I downloaded php_mongo.dll and put it in ../php5.3.0/ext folder. Then I added extension=php_mongo.dll to php.ini. When I restarted WAMP, I got the following errors:
PHP Startup: unable to load dynamic library php5.3.0/ext/php_gd2.dll
and the same error for
php_mbstring.dll,php_mysql.dll,php_mysqli.dll,php_pdo_mysql.dll,php_pdo_sqlite.dll.
After that, I got another error:
PHP Startup: Mongo: Unable to initialize module
Module compiled with build ID=API20090626, TS, VC9
PHP compiled with build ID=API20090626, TS, VC6.
These options need to match.
After some reading up from the net, I realize that I have to change the compiler for PHP. Does anyone know on how to update php compiler VC6 to php compiler VC9?
My Apache version 2.2.11
PHP version 5.3.0
thank you
http://windows.php.net/download/
Download the zip file for VC9 x86 Thread Safe (which is for PHP run as Apache module).
Extract the contents of the zip somewhere
Stop apache
Backup the php.ini file you have in your current PHP directory ../php5.3.0/
Delete (or backup) the rest of the contents you have in ../php5.3.0/
Place the extracted content in ../php5.3.0/
Put php_mongodb.dll in ../php5.3.0/ext/
Put php.ini back also
Restart Apache
edit:
Sorry, I forgot to mention that you also need to replace your apache install with the one from apachelounge as well, and have Microsoft 2008 C++ Runtime (x86) or the Microsoft 2008 C++ Runtime (x64) installed, as per the remarks in "Which version do I choose?" on the same page http://windows.php.net/download/
For time being, check which module is in warning message, just go to php.ini file and comment it. This could work

Categories