SAPRFC dll and PHP 5.5 - php

I wanted to try using SAPRFC dll along with PHP to retrieve data from SAP server at our company, but after downloading the latest version (1.4.1) from http://sourceforge.net/projects/saprfc/files/
Then, I added the dll files (php_saprfc_528.dll and php_saprfc_530.dll) to PHP extensions folder, then I updated php.ini file. When I start Apache server, the following error message shows to me
PHP Startup: saprfc: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20121212
These options need to match
Googling this issue, I found that that saprfc was compiled with another version of PHP not same as the one I'm using. I'm running PHP 5.5.9, so I started looking with saprfc dll file compatible with PHP 5.5, but I couldn't find.
Can anybody please provide the download for the php_saprfc.dll which will work with PHP 5.5, or what are the steps for compiling php_saprfc.dll that will make it compatible with PHP 5.5
Thanks

Compiled php module you can download here: https://sourceforge.net/projects/saprfcsapnwrfc/files/?source=navbar

Have you installed the RFC DLL on the system in question? At runtime the SAPRFC PHP module needs it - from the installation instructions (As you mentioned DLL I'm assuming you're using Windows):
For installation (from binary package):
PHP binaries (http://www.php.net/downloads.php)
librfc32.dll in Windows System directory (or SAPGUI installed)
You can obtain librfc32.dll from a system that has SAPGUI installed (check the Windows directory) or by installing the classic RFC SDK. For more information on that SDK, see note 27517 (SAP SMP login required).
Once you've done that and if the PHP module still doesn't work, then you can consider recompiling. See the instructions in that same installation guide for instructions. They do mention Visual C 6.0 though, which is rather old...

Related

php version in plesk - extension installing on wrong version

I've just installed plesk on centos 7, it has multiple php versions installed.
7.1.10 was turned on and was the preferred version to use
However, i've tried to install phplib but it never loads on 7.1.10.
Have installed phplib perfectly fine, yet when you place pdf.so on the php.ini file it never load the extension.
I then noticed that pecl was installing the files in /usr/lib64/php/modules when php claimed they were in /opt/plesk/php/7.1/lib64/php/modules
That got me thinking that it must be installing it on a different php version, so I turned on the default php version of 5.4.16 and what do we have? pdf.so now loads and displays pdflib in the php config page.
Any ideas how to get it working on php 7 under plesk?
I would recommend to do the typical installations steps.
download the current PDFlib package for your Linux (64-bit) PHP and unpack the archive on your server
pick the correct PDFlib PHP DSO for your used PHP version (see bind/php/php-*)
get the correct extension_dir path from your phpinfo() output.
copy the PDFlib PHP DSO to the extension_dir
determine the correct php.ini from the phpinfo() output
add extension=php_pdflib.so to the php.ini
after a restart of your webserver, you should see a "PDFlib" section in the phpinfo() output.
Please see also the PDFlib in PHP Howto or PDFlib 9.1 Tutorial, chapter 2.9 "PHP Binding" for more detailed introduction how to install PDFlib.

php starup sqlsrv unable to initialize module

I am trying to connect MSSQL to PHP. i am following this tutorial. Anyway after i added the dll files as described in that tutorial, i get the following warning. How can i solve this ?
php starup sqlsrv unable to initialize module module compiled with module api=20090626 php compiled with module api=20020520 these options need to match
note:i have gone through this post but none helped.
Looks like you've tried to install the sqlsrv extension for php 5.3 on a php 5.2 system.
Either run <?php phpinfo(); ?> and look for the php version and look for the following entries:
PHP Version
Thread Safety
pick the appropriate .dll from the sqlsrv driver: the version number must match and if thread safety is enabled pick the ts version, if not pick the nts version.
For anyone trying to get it to work with PHP 5.5 (PHP compiled with module API=20121212) then you can replace the dlls in the ext folder with new updated binaries >here<
Don't forget to enable the new dlls in the php configuration.
In my case the issue was with multiple php version under an Apache. The php cli loaded another php version's php.ini. The takeaway is: always check the configuration before you dig deeper into the problem.

Compiling a PHP extension as non-thread-safe

I am trying to compile the imagemagick (imagick) extension to use in a non-thread-safe environment on windows.
I am using PHP 5.3.10 and have set up Visual C++ express as my compiling environment.
The problem is that I am using a non-thread-safe version of PHP as a FCGI module in Apache 2.2.
Thus, my PHP is supplied with a php5.lib and not a php5ts.lib. I believe this is the reason why I am getting these errors:
imagick.obj : error LNK2019: unresolved external symbol __imp__tsrm_mutex_alloc referenced in function _zm_startup_imagick
I have only ever built and compiled things on linux, so am not too sure how to do this on a windows environment.
How can I compile the extension so that it is non-thread-safe?
I downloaded the threadsafe binary of PHP 5.3.10 to get a copy of php5ts.lib. I was then able to compile the extension.
I am guessing that setting the ZTS preprocessor directive to either 1 or 0 would cause the extension to compile as either threadsafe or non-thread-safe. (Not too sure about this, so if someone could let me know if this is correct or not, it would be much appreciated. :) )
I then set up a virtual machine running Windows 7 and installed the latest version of WAMP. Reason being that it used a threadsafe version of PHP.
I placed the dll in the ext folder in the PHP installation and enabled it in php.ini. However, even after trying both the ts and nts version in WAMP, I would get:
PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.3.10/ext/imagick.dll' - The specified module could not be found.
in Unknown on line 0
But the thing is that c:/wamp/bin/php/php5.3.10/ext/imagick.dll' does exist, and yes I have checked this a lot of times.
I then downgraded ImageMagick to 6.6.2-10-Q16, but still see the same problem.
The same issue occurs on my dev machine running a nts version of PHP 5.3.10 on Apache 2.2 (all installed manually).
Looks like I could be wrong regarding the ZTS preprocessor. If I set ZTS=0 and compile, using dependency walker on the compiled dll still shows that it requires php5ts.dll which is only present on threadsafe versions of PHP.
I did more tinkering with dependency walker and found that I had to statistically link to msvc100d.dll. I then removed ZTS in the preprocessor definition and was able to compile using php5.lib instead of php5ts.dll. I think this should get me a non-ts dll.
However, when loading the extension, I am still getting:
PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) 'imagick.dll' in Unknown on line 0
And errors from dependency walker:
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
Installed visual c++ express 2008 and compiled using platform toolkit v90, but still facing the same issues.
Any tips appreciated :)
Solution Found! See my answer.
Got it! I hope this can help those compiling php extensions on windows in the future. What I have done is based on: https://wiki.php.net/internals/windows/stepbystepbuild
Note: I read an answer on this site that said compiling PHP extensions by itself on windows is unsupported. Based on my experiments yesterday, it seems to be a lot of work as well, so I am using the PHP build process.
The best way is to use the PHP build process.
Install Visual C++ Express 2008 (any version will do, but express is free) and Windows SDK 6.1 (note that we want the 6.1 version not anything older or newer).
Install the SVN client tools if you haven't done so and restart for your PATH variable to take effect.
Get the PHP SDK binary tools and extract it to C:\php-sdk.
Start the CMD Shell under Microsoft Windows SDK v6.1 in your start menu and run cd C:\php-sdk.
Run setenv /x86 /xp /release this creates a 32-bit release. You can use /x64 to build a 64-bit release (I have not tried this).
run bin\phpsdk_setvars.bat
run bin\phpsdk_buildtree.bat php53dev
Download the PHP source code and extract it to C:\php-sdk\php53dev\vc9\x86 so that you end up with C:\php-sdk\php53dev\vc9\x86\php5.3-xyz
Download the latest deps and extract everything to C:\php-sdk\php53dev\vc9\x86. You may be prompted to overwrite any existing folders, so press yes.
run cd C:\php-sdk\php53dev\vc9\x86
Check out the latest version of your extension from the svn repository: svn co http://svn.php.net/repository/pecl/imagick/trunk pecl/imagick I am checking out imagick here.
Install any dependencies. In my case, I need to install ImageMagick, so I downloaded the latest recommended windows binary. You will need to restart after installation to update your PATH variable, but you can do this after you have compiled. Make sure you install the C/C++ headers and includes as well.
Copy the contents of the includes directory from the ImageMagick install directory to C:\php-sdk\php53dev\vc9\x86\deps\include.
Copy the contents of the lib directory from the ImageMagick install directory to C:\php-sdk\php53dev\vc9\x86\deps\lib
Now, let's build: run cd C:\php-sdk\php53dev\vc9\x86\php5.3-xyz then buildconf then configure --help. Look at the help properly. It will show you all config flags and any avaliable extensions to enabled. In my case, since I added imagick, I had an option called --with-imagick
Run config: configure --enable-cli --with-imagick=shared --disable-zts If you want to build a non-thread-safe binary use --disable-zts, otherwise remove that configuration flag. I am not sure why, but sometimes extensions use the --with-myextension flag and sometimes --enable-myextension, so check configure --help for the flag to use. If you add =shared after the extension flag, it will be compiled as a separate DLL, which si what we want.
Compile: run nmake then nmake snap.
Done :) Check C:\php-sdk\php53dev\vc9\x86\php-5.3.10\Release (non-thread-safe) or C:\php-sdk\php53dev\vc9\x86\php-5.3.10\Release_TS (thread-safe). Your compiled binaries should be in there. The compiled extensions (pecl), should be in a ZIP file similiar to pecl-5.3.10-nts-Win32-VC9-x86.zip. Open this file and extract the extensio DLL to your ext folder in your PHP installation.
Enable the PHP extension and restart your webserver. Run phpinfo() and check that the extension is enabled.
If the extension does not work properly, make sure you reboot to update your PATH variable. In my case, I need to have the imagemagick install directory in my PATH variable.
???
Profit!
Is there a reason you need to compile? Why not download? It's usually much simpler/quicker on Windows.
VC6: http://www.sk89q.com/2010/03/vc6-windows-binaries-for-imagick-2-3-0/
VC9: http://valokuva.org/builds/

WAMPSERVER php_memcache extension

I have a copy of php_memcache.dll (from php_memcache-2.2.6-5.3-nts-vc9-x86.zip) which I have placed in my C:\wamp\bin\php\php5.3.5\ext folder.
In WAMP I can see php_memcache in my extensions list, however whenever I start the extension I get the following warning:
PHP Startup: Unable to load dynamic
library
'C:/wamp/bin/php/php5.3.5/ext/php_memcache.dll'
- The specified module could not be found.
This does not happen for any other extension that I can turn on or off.
Have tried moving php_memcache.dll to C:\windows\system32 but makes no difference.
Any ideas?
Your extension probably not fit the compilation mode of wampserver.
Is it compiled with vc9 (visual 2008) and a non threads safe support ?
My wampserver (latest available) is compiled in VC6 TS.
To know this info check phpinfo() on line :
Compiler
Thread safety
I'd suggest trying other versions of the dll.
2.2.5.0 works for me using WAMP.
The VC9 builds are the only supported builds. VC6 (which is used as convenience builds by Apache) is not supported anymore.
Latest PHP version (and PELC extensions) are only available as VC9 builds. Xamp are already moving their suite to VC9, other already did. You can also do it yourself using apachelounge.com builds, which are the ones we recommend to use with PHP Binaries.

How do I enable the PHP HTTP PECL extension on Windows?

I have an installation of XAMPP version 1.7.3 on Windows 7 x64. I want to enable the PHP HTTP extension. How do I go about doing so? That is, where to I get the DLL, register it, etc. Thanks in advance.
First, download the PECL module from the php website.
Then unzipp it and copy the file php_http.dll in your PHP extension folder. Then edit your php.ini file (c:\WINDOWS\php.ini) and activate the module :
extension=php_http.dll
As you are on an earlier PHP Version, you can get the build from: http://downloads.php.net/pierre/
If you upgrade to XAMPP 1.8.3, which uses PHP 5.4, then you should take a look at the closed bug about this found at: bugs.php.net/bug.php?id=62056
As per details in the bug comments; I downloaded the ts (thread safe) version for XAMPP 1.8.3 from github.com/stealth35/stealth35.github.com/downloads and listed as "php_http-1.7.4 -5.4-vc9-x86.zip"
The latest builds can be found at: windows.php.net/downloads/pecl/releases/http/1.7.5/
Amoung those links you should find a version specifically for what you need.

Categories