PHP OCI8 extensions not working with PHP 7 64 bit - php

I have installed APACHE 2.4 x64 and PHP7 x64 and download PHP OCI 64bit libraries but the problem is that whenever I run PHP script from cli it says
PHP Startup: Unable to load dynamic library
'E:\software\server\php-7.0.11-Win32-VC14-x64\ext\php_oci8_11g.dll' -
%1 is not a valid Win32 application
Also when I invoke the webapplication from URL it says
Call to undefined function oci_pconnect()
The OCI extension I downloaded are also 64bit. Here is the link:
http://windows.php.net/downloads/pecl/releases/oci8/2.1.2/php_oci8-2.1.2-7.0-ts-vc14-x64.zip
Can someone guide on this problem.

You've probably mixed TS (thread safe) and NTS (non-thread safe) versions. These will not work together. Find out more about PHP thread safety here.
PHP 7.0.11 NTS x64, OCI8 2.1.2 NTS x64, and InstantClient 11.2.0.4.0 x64 work perfectly well together (I've just downloaded these three files and tested them in a fresh Win2K8 environment).
Remember to install the latest VC14 runtime (Visual Studio 2015) and to modify your PATH system environment variable to include the directories of PHP and the InstantClient, e.g. C:\php;C:\instantclient_11_2.

Related

PHP Error: Unable to load dynamic library php_intl.dll, not a valid win32 application?

I installed WAMPP web server, and now after configuring php.ini to use Netbeans for PHP coding (following this), I had to restart the Apache and MySQL servers. I actually stopped them and tried to start again, and I am getting this error:
PHP Startup: Unable to load dynamic library 'C:xampp\php\ext\php_intl.dll' - %1 is not a valid Wind32 application.
I am on a 64 bit Windows 7 OS.
I installed XAMPP v1.8.3 (got from www.apachefriends.org)
My PHP version (got from phpinfo() is PHP version 5.5.11.
I have tried solutions to the questions addressing the same issue.
1. I tried to copy all the icu*.dll's to apache>bin directory, no joy. They were already there. I did not replace them.
2. I have my extension=php_intl.dll uncommented and points to the right directory. To no gain.
3. I added the directory of icu*.dll files to my system environment variables, did not help.
4. My php_pdo_firebird.dll in php.ini is already commented out.
Now, not a valid win32 application makes me think I have something for 64bit OS and it should be for 32bit OS.. But what is it? What do I do about it?
Please help me resolve this error.
You have to install Miscrosoft Visual C++ Redistributable.
Use x86 version if you use 32bit PHP.
Use x64 version if you use 64bit PHP.
If you are not sure which PHP you use, install both versions of Miscrosoft Visual C++ Redistributable. Nothing will break.
For PHP 7.2, PHP 7.3 and PHP 7.4 you need version 2017 (VC15).
Download Visual C++ Redistributable for Visual Studio 2017
Older versions (2015 or 2012) are not needed if you install this one.
For PHP 7.0 and PHP 7.1 you need version 2015 (VC14).
Download Visual C++ Redistributable for Visual Studio 2015.
For PHP 5.6 you need version 2012 (VC11).
Download Visual C++ Redistributable for Visual Studio 2012
Change/Add env variable for PATH to your php version
Download Visual C++ will resolve

PHP APC Cache for PHP 5.4.22 Win 7

I need to install APC cache for
Windows 7
Php 5.4.22
can anyone provide me with a binary ? or instructions on how to build one for windows for the specific version of PHP
I see there are binaries available for PHP 5.4.6,5.4.7 etc but not able to find one for 5.4.22
i tried the binaries for 5.4.6 and 5.4.7 but I runtime errors saying that the server stopped working due to an error in the apc.dll.
There is no specific error message
How to install: http://docs.moodle.org/24/en/Installing_APC_in_Windows
Download locations:
http://dev.freshsite.pl/nc/php-accelerators/apc/download/
but first you should check what PHP you have installed (You can find it in phpinfo();):
PHP 5.4.6
PHP 5.4.6 VC9
PHP 5.4.6 nts
PHP 5.4.6 VC9 nts

Installing PHP 5 on Windows Server 2003 - %1 is not a valid Win32 application

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.

MongoDb php extension not loading

I'm trying to load the MongoDb extension for php on a Windows 7 64 bit PC, running XAMPP with Apache 2.0 and PHP 5.3.5, compiler version VC6. I started out with this tutorial, and have also tried the extensions that the php documentation suggested. MongoDb itself is running fine, and shell commands seem to work.
At the moment I have:
Added extension=php_mongo.dll to my php.ini file.
Put the VC6 version of php_mongo.dll (from the following download page, suggested by the PHP documentation) in the php/ext folder.
Restarted my Apache server.
I have also tried php_mongo.dll files form Stealth's github, but they didn't seem to work either.
When restarting Apache, I don't get any errors, but I can't find anything on MongoDb in phpinfo(), and the Mongo class is not recognised either.
Any ideas of what might be wrong? Let me know if you need more info.
The problem might be incorrect version of extension. Try different versions downloaded from here: http://pecl.php.net/package/mongo/1.6.4/windows
Use Bitnami WAMP Stack instead of XAMPP it comes preloaded php_mongo.dll driver installed and no need to configure php.ini file
There is no official MongoDB Driver released for PHP7. So it would be better to download the recommended PHP version 5.5.30(currently) offered by Bitnami Wamp Stack.
There might be two reasons:
First one is as #Sadd suggested. Your mongodb extension should be loaded after what you have done so its very likely that you have enabled extension in wrong file. And yes, there are two such similar files (named php.ini-development and php.ini-production on windows computers), so make sure to enable it in php.ini file and run the following code echo extension_loaded("mongodb") ? "loaded\n" : "not loaded\n"; and you should see loaded on screen.
If you still don't see it, then the second thing you can do is to check whether the version is right or not. You can check your phpinfo() for your php version and then put the right versioned dll file in ext folder. In this, you can have to check whether your php is ts or nts and second one is whether your php is x64 or x86. I hope you are good to go after one or both of the changes.
This was driving my crazy until I looked closely at my PHP version:
$ php -v
PHP 7.4.1 (cli) (built: Dec 17 2019 19:23:59) ( NTS Visual C++ 2017 x64 )
Notice that it says PHP 7.4.1 and NTS and x64? This means that when I download from PECL, I need version 7.4 Non Thread Safe (NTS) x64 or it won't run correctly.
If the correct version of module is not added, an error is thrown.
[PHP Warning: PHP Startup: Unable to load dynamic library 'php_mongodb.dll' (tried: C:\xampp\php\ext\php_mongodb.dll (The specified module could not be found), C:\xampp\php\ext\php_php_mongodb.dll.dll (The specified module could not be found)) in Unknown on line 0]
When downloading the dll extension from https://pecl.php.net/package/mongodb, make sure that NTS (Non Thread Safe) or TS (Thread Safe) is chosen according to what shown from php -v command.
$ php -v
PHP 8.1.7 (cli) (built: Jun 7 2022 21:45:53) (ZTS Visual C++ 2019 x64)
Although here it shows ZTS, TS version can be used in this case.

Compiled dll for APC extension for PHP 5.3

This might not be a programming question but I am posting it after long search and confusion.
I have a dedicated server running Windows server 2008/64bit running Apache as a web server and using PHP 5.3.9
I am trying to install APC extension for Apache. From what I found on php.net I should use a V6 version because I am using Apache.
I searched everywhere to find APC for PHP 5.3 vc6 x64 and found nothing
This comment says that "it’s not possible to compile 64 bit PHP binaries with VC6 since it does not have 64 bit compiler" I don't know if that's true or just an assumption
Any help will be gladly appreciated/
Update, I cannot use VC9 as stated on windows.php.net
If you are using PHP with Apache 1 or Apache2 from apache.org you need to use the VC6 versions of PHP
If you are using PHP with IIS you should use the VC9 versions of PHP
VC6 Versions are compiled with the legacy Visual Studio 6 compiler
VC9 Versions are compiled with the Visual Studio 2008 compiler and
have improvements in performance and stability. The VC9 versions
require you to have the Microsoft 2008 C++ Runtime (x86) or the
Microsoft 2008 C++ Runtime (x64) installed
Do NOT use VC9 version with apache.org binaries
VC9 versions of Apache can be fetched at Apache Lounge. We use their
binaries to build the Apache SAPIs.
Thanks
UPDATE
I was given wrong information about the server configuration and settings. phpinfo() revealed the following:
Compiler MSVC9 (Visual C++ 2008)
Architecture x86
So I used built VC9 and x86 and it worked perfectly.
I used to run PHP as an Apache module on my Windows development machine. However, as PHP has stopped releasing VC6 binaries, I run the VC9 non theadsafe 32-bit versions as a FCGI module. There is plenty of documentation from both Apache and PHP on how to install these.
Then all you have to do is download the latest APC dll from here. Make sure you get the non-threadsafe version (nts), plonk it in your ext folder and just enable it like any other extension.
Edit: Didn't see that you wanted to run the 64-bit version. I haven't had a chance to try that out. However, if you are happy with running 32-bit versions of Apache and PHP, the above should work well.

Categories