How does one build WINCACHE .DLL from source files? - php

I downloaded WINCACHE-1.3.7.4.tgz from the PECL download page. Unpacking it i find many a C orientated source file. Compiling from source in Linux i have some experience in BUT none at all in Windows (i am running Windows 7).
The instructions on PHP.net's WinCache pages does not seem to match the files extracted from the `.tgz'
I have looked at suggested questions
Creating Windows DLL from C++ source files
Creating php DLL from pecl source files
but i have NO idea where to actually start off.
And thus, does anyone know how i would build WinCache .DLL from the provided source? (if at all easily possible)

Do you really need to build this extension from source? If not, you can download precompiled DLLs here. If yes, you have to follow this tutorial for compiling PHP extension on Windows. Basically, you have to build PHP and it will also compile extension that you will enable. After successful compilation you should be able to find required dll and use it with your running PHP.
But another question is for what do you need it? What version of PHP do you use? If 5.5+ you should consider OPCache instead WinCache.
Since the Zend Opcache extension is now in the core PHP product, the WinCache opcode cache is disabled by default. As of PHP 5.5, the opcode cache portion of WinCache is deprecated, and will be removed in a future release of the WinCache extension.

Related

PHP install mailparser extension

I want to install mailparser extension.
I downloaded php_malparse.dll ( put it to php/ext folder).
Also added : extension=php_mailparse.dll to php.ini
But it doesn't work, and php_info() doesn't show it too.
In logs I get:
PHP Warning: PHP Startup: Unable to load dynamic library 'E:\xampp\php\ext\php_mailparse.dll' - %1 \xef\xbf\xbd\xef\xbf\xbd \xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd‌​\xef\xbf\xbd \xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd‌​\xef\xbf\xbd\xef\xbf‌​\xbd\xef\xbf\xbd\xef‌​\xbf\xbd\xef\xbf\xbd‌​\xef\xbf\xbd Win32.\r\n in Unknown on line 0
I need help, how can I solve this problem?
Thanks!
It's difficult to say what's going on here. Typically the message Unable to load dynamic library means the library (in this case on Windows the .dll file) is not correctly formatted and the OS was unable to map it into memory or PHP was not able to use it.
Some possible reasons include:
The extension was not compiled for the same architecture as the target PHP build (e.g. the PHP is x86-64 but the library is x86)
The extension was not compiled using the same runtime version; PHP is pretty strict about this (e.g. PHP5 is built with vc11 on Windows, PHP7 is built with vc14, ETC.)
The extension was not compiled against the same version of the PHP API or extension API used by your PHP build; typically PHP will show a more-detailed error message when this is the case (it's strange that your error message contains a bunch of non-printing characters though...)
To double-check all this, view a dump of phpinfo() to see what kind of PHP you have. Look for the PHP API and extension versions as well as the system architecture and whether thread safety is enabled. Then return to where you downloaded the php_mailparse.dll extension library and make sure the extension aligns with your PHP build. Here are some official instructions for this process for Windows PHP extensions.
I found official builds of this module here. There are a lot of different choices to pick from. Pay attention to ts (i.e. Thread-safe) vs nts (i.e. Non-thread-safe), x86 vs x64 (i.e. the architecture) and vc11 vs vc14 (i.e. the runtime version). You may have to experiment until you find one that works for your PHP build.
It might also be worth checking out the official install instructions for the mailparse extension. Note especially that the mbstring module has to be loaded first for it to work.

How to install SAPRFC with PHP 5.4.4 in Windows 32 system?

I've tried a lot of things given over the internet to setup SAPRFC in Windows but they all are talking about PHP 5.2 version but everyone knows that we are using PHP 5.x nowadays.
I'm running Xampp server where my PHP version is 5.4.4 and I need to communicate with SAP server through PHP script. I've tried the procedure of copying librfc.dll in system32 folder and php_saprfc.dll in php/ext folder and also modification of php.ini but it doesn't help me.
I have to following instructions:
Installation:
Extract zip file saprfc-$VERSION$-$PHP_VERSION$.zip
Copy php-saprfc.dll to your extensions directory (e.g. C:\PHP\extensions)
Edit php.ini file (in windows system directory, e.g. C:\WINNT, C:\WINDOWS) and add line: 'extension=php_saprfc.dll'
Copy librfc32.dll (from SAPGUI install CD) to the Windows system directory or simple install SAPGUI on your machine.
Compilation:
Extract php sources to C:\PHP-x.y.z
Extract php win support files to C:\PHP-x.y.z\win32
Install RFCSDK to C:\PHP-x.y.z\rfcsdk
Copy SAPRFC sources to C:\PHP-x.y.z\ext\saprfc
Copy php4ts.lib or php5ts.lib (from PHP binaries) to C:\PHP-x.y.z\win32
For PHP5 copy saprfc.dsp5 to saprfc.dsp
Open project C:\PHP-x.y.z\ext\saprfc\saprfc.dsp in Microsoft Visual C++ 6.
Under Tools|Option|Directory set path for Include files and for Library files:
(C:\PHP-x.y.z\win32\include; C:\PHP-x.y.z\rfcsdk\include;
C:\PHP-x.y.z\win32\lib; C:\PHP-x.y.z\rfcsdk\lib)
Set active configuration to "saprfc - Windows_TS" (under Build menu)
Build php_saprfc.dll.
Compiled DLL you find in C:\PHP-x.y.z\Release_TS directory
But I'm not getting the compilation part.
The newest version is from 2009 and can be found here. For newer PHP versions you have to compile the extension yourself (at least the docs say so). Seems like the devs didn't make the jump to the newer versions because of the compiler needed. In the compilation docs it still says Microsoft Visual C++ 6.0. AFAIK modern PHP uses 9.0. So you propably need to tinker a bit with it. Or you might ask in the SAP forums if someone did the necessary work already.
You can download precompiled version here:
https://sourceforge.net/projects/saprfcsapnwrfc/files/

Where to download iMagick PHP extension VC6 and VC9

I would like to use iMagick with my PHP web page, but I can't find where to download an official PHP extension for Windows compiled with code http://pecl.php.net/package/imagick
I found some links on the web like :
http://valokuva.org/outside-blog-content/imagick-windows-builds/php53/imagick-2.3.0-dev/
http://dev.freshsite.pl/php-extensions/imagick.html
But some PHP extensions are very old and makes Apache crash, others are working.
And how can I trust the DLL code inside?
Is there a trusted web site where I could donwload iMagick PHP extension compiled with VC6 and VC9?
Try to have a look here usually these extensions work quite well.
For production server is better to compile it from source code using PECL, Visual Studio or Windows SDK
Imagemagick source codes on Pecl
How to build php extension on Windows
I also spent hours trying to install imagick on windows 7. Only this solution worked https://mlocati.github.io/articles/php-windows-imagick.html
It tells exact versions that will work with my system. Please note that usually windows are 64 bits but php on xampp has x84

PECL Extensions for Windows

Where can I download extensions from PECL for PHP 5.3? I find that the links are only for 5.2.6, and the site of PECL4Win is discontinued.
I tried to download extensions from PECL on the site but the code is written in C and I can not compile the files and get the .dll.
Why can't you compile the C files? There is a lot of tutorials out there that show you how to do it. It takes an hour or two to get all configured and setup, but it's worth it because you don't need to wait in the future for new .dll files to come out, you can just compile yourself.
https://wiki.php.net/internals/windows/stepbystepbuild
On php it says:
PECL extensions for Windows is being worked on. The interface on the pecl website will most likely be updated to offer Windows DLL download right from that website.
In the meantime, some extensions can be found here.
http://pecl.php.net/

PECL extension for Windows

I found a few related posts here but didn't get my answer. So posting again.
How would I install a PECL extension on windows? Say I want the PECL oAuth extension on Windows XP.
I know 2 methods, but none of them is working for me.
The site http://pecl4win.php.net/ is down for months. So I cant download the DLL. Is there any place we can download the DLLs from ?
running the command
pecl install oauth-0.99.9.tgz is throwing the error
The DSP oauth.dsp does not exist.
I tried with few other extensions also and getting the same error.
What am I missing here?
Releases can now be found here:
http://windows.php.net/downloads/pecl/releases/
If you need an extension not available there you might ask on the pecl-dev at lists.php.net mailing list.
I got what I am looking for in http://windows.php.net/downloads/pecl/releases/
Currently PECL for windows is in an odd reformation state. The reason being that I believe they are trying to provide VS2008 source versions. I would actually suggest using Zend Server for now until the windows half of the php group gets everything fixed up. Zend Server includes almost all of the extensions that you can find in PECL, and everything else, if you are lucky, you could find an compile yourself.
The PECL installer downloads the source code of the extension and tries to compile it with your local C compiler. The problem is that the whole process is designed for Unix systems, where a C compiler is available or can be easily installed. Setting an environment to compile C code under Windows is pretty complicate.
The ideal solution is getting a DLL file that someone already compiled. That's what the pcle4win site was for. However, there's currently no official repository to download PECL DLLs so you only have two alternatives:
Find an unofficial DLL somewhere in Google
Compile it yourself (another link) with Microsoft Visual Studio
It'd be cool that there was a DLL repository out there but I'm unaware of any.
The php source ships with a set of configuration scripts for windows (using windows script host) that mimics the autoconf tools as far as php is concerned. If you place the code for the extension in a directory under the /ext directory (where all the other extensions like bcmath, bzip, ... are located) you can let the buildconf-script create a makefile that includes the build rules for that (new) extension.
There's a step-by-step walk-through at http://wiki.php.net/internals/windows/stepbystepbuild which seems to be brief but feasible.
compiled oauth: http://windows.php.net/downloads/pecl/releases/oauth/
another pecl extension: http://windows.php.net/downloads/pecl/releases/

Categories