Installing php_svn.dll extension in the Zend Server CE - php

I've been trying to add the php_svn.dll extension into the zend server for a few days now.
Below is my setup:
Zend Server Community Edition: 5.5.0
PHP:5.3.8-ZS5.5.0
Web Server Server Software: Apache/2.2.16 (Win32) mod_ssl/2.2.16 OpenSSL/0.9.8o
Zend Framework: 1.11.10
I used the zend server CE installer to set up my stack.
As for retrieving the php_svn.dll, because http://pecl.php.net/package/svn is not available (not to mention hosts thread-safe extensions - which are incompatible to zend), I basically had to build from source a non thread safe version of PHP and the SVN extension. (Like the zend stack, the PHP source is 5.3.8 as well)
To build PHP I followed the steps in https://wiki.php.net/internals/windows/stepbystepbuild. And to build the SVN extension, I ensured that I had the dependencies asked for in the extension's config.w32. Things seem to have gone smoothly here because I managed to get a php_svn.dll.
I then copy-pasted the resulting php_svn.dll from <php_source_dir>\Release\ into my <zend_install_dir>\ZendServer\lib\phpext\ and added the new .dll in php.ini file hoping things would finally work. However, when I restarted the zend server, I got the following log-entry:
PHP Warning: PHP Startup: Unable to load dynamic library
'C:\zend\ZendServer\lib\phpext\php_svn.dll' - The specified module
could not be found. in Unknown on line 0
Am I missing anything here?
EDIT
I figured it out!
The next step here was to simply take the .dll equivalents of the svn extension's .lib dependencies and place them onto the ZendServer's bin directory.

Related

Loading Mongo Driver 1.6.x driver on WAMP 64bit architecture

So I've installed 64bit Apache/PHP locally. Both Apache and PHP were compiled against the VC11 C++ redistributable.
https://www.apachelounge.com/download/VC11/ and
http://windows.php.net/download/ PHP5.6 (Yes... ) x64 Thread Safe (respectively)
Both work fine! (screenshots with version and architecture info inc.)
I've downloaded multiple varaities of the 1.6.x driver from both PECL and an repo' at Amazon.
https://pecl.php.net/package/mongo/1.6.14/windows
https://s3.amazonaws.com/drivers.mongodb.org/php/index.html
I've made sure they're the x64 Thread Safe variety and added to my ~/php/ext folder.
I've made sure the extension is loaded in php.ini (and that the write .ini file is called):
extension=php_mongo-1.6.8-5.6-vc11-x86_64.dll
But everytime I restart Apache I get this in my PHP error log:
[07-Jun-2017 20:21:20 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'E:\PHP5.6\ext\php_mongo-1.6.8-5.6-vc11-x86_64.dll' - %1 is not a valid Win32 application.
(Apache comes up clean. Error.log clean)
Why is it protesting that this is not a Win32 Application. I don't want it to be. My entire architecture is 64bit and so is the Mongo Driver.
In case anyone else comes across this thread. After hours of trying to get it to run I just downgraded everything to 32-bit. Worked right out the gate.
Despite PECL offering a "64bit" driver - https://pecl.php.net/package/mongo/1.6.14/windows it didn't seem to be compatible with 64bit/VC11/Thread Safe versions of Apache/PHP
I'm not sure if this is an issue with the Mongo driver compilation or something deeper?
Anyway. Downgrade to 32-bit. Mongo 1.6.x drivers will then run.
From php.net
In order for this extension to work, there are DLL files that must be available to the Windows system PATH. For information on how to do this, see the FAQ entitled "How do I add my PHP directory to the PATH on Windows". Although copying DLL files from the PHP folder into the Windows system directory also works (because the system directory is by default in the system's PATH), this is not recommended. This extension requires the following files to be in the PATH: libsasl.dll
http://php.net/manual/en/mongo.installation.php#mongo.installation.windows
Simply copy libsasl.dll from your PHP directory to your Apache\bin directory and restart Apache.
It is possible that a dependency is missing. Where I suspect that to be libsasl as alluded to in the comment at http://php.net/manual/en/mongodb.requirements.php
The libsasl.dll can be found in the PHP distribution.

Windows Server 2012 r2 + XAMPP + SqlSrv = unsuccessful so far

I have a Windows 2012 R2 server with XAMPP installed. I need to connect to a Microsoft SQL Server database but I saw the mssql-library is no longer supported and I was redirected to the official Microsoft package SqlSrv.
I've unzipped all files to d:\xampp\php\ext and I've added extension=php_pdo_sqlsrv_56_nts.dll in my php.ini.
Using XAMPP's controlpanel I've restarted Apache but it didn't work. I'm always getting the errors:
[20-Apr-2015 08:38:08 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'D:\xampp\php\ext\php_pdo_sqlsrv_56_nts.dll' - The specified module could not be found.
in Unknown on line 0
[20-Apr-2015 08:38:08 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'D:\xampp\php\ext\php_pdo_sqlsrv_56_nts.dll' - The specified module could not be found.
in Unknown on line 0
I've checked a few times to be sure the filename is correct. The file truely exists. All system users have full control over the file (any file in the \ext directory for that matter). It also doesn't matter to switch to a ts or non-pdo variant.
I'm running PHP 5.6.3. Any suggestions? I'm out of ideas to look for the issue...
Update 1:
Via several form posts I came across a C++ Redistributable to install, so I've got that covered. But still I'm missing out on some DLL's according do depends.exe (Dependency Walker).
To this point I'm missing the following DLL's:
API-MS-WIN-CORE-KERNEL32-PRIVATE-L1-1-1.DLL
API-MS-WIN-CORE-PRIVATEPROFILE-L1-1-1.DLL
API-MS-WIN-SERVICE-PRIVATE-L1-1-1.DLL
PHP5.DLL
API-MS-WIN-CORE-SHUTDOWN-L1-1-1.DLL
EXT-MS-WIN-NTUSER-UICONTEXT-EXT-L1-1-0.DLL
IESHIMS.DLL
SETTINGSYNCPOLICY.DLL
WLANAPI.DLL
I assume they're part of a package I'm missing. I also saw some posts about installing the latest SQL Server Native Client. But as far as I found the latest version is 11, but is too old for Windows 2012R2.
Update 2:
On this forum page I saw a useful reaction (in German) telling SqlSrv can't work with the latest available XAMPP PHP version. So I've reinstalled XAMPP with PHP 5.5.19 now, but this still didn't help.
How to proceed?
Okay, I've found out what's wrong.
At this moment I'm succesfully running SqlSrv on my Windows 2012R2 machine with XAMPP. The main problem was I was using the *nts.dll files. Using Dependency Walker I was able to get a list of dll's that were not loaded succesfully. One of the DLL's listed there was php5.dll. It took me a while to figure out that would be strange. I've inspectected my php folder and I saw the file php5ts.dll in there, but no php5.dll So I Googled for sqlsrv php5.dll and I came across this page from Microsoft.
That page lists which drivers work with which DLL for PHP. I've switched the modules from nts to ts and now everything is working as expected. At this moment I've also installed the C++ redistributable to fix the MSVCP110.dll issue but I'm not sure if that was mandatory to get it working. If you run into the same issue maybe you'll also have to install this patch (Microsoft downloadpage, I've downloaded VSU_4\vcredist_x86.exe)
Good luck future solution seekers!

How to install Zend Guard Loader on Xampp

I have been using a software which files are encoded by Zend Guard. Since PHP 5.3 + versions don't support Zend Optimizer hence I have to install Zend Guard Loader to run that application on my windows xampp installation.
I downloaded Zend guard loader and copied to xampp folder.Then I edited the following lines to php.ini file.
zend_extension ="E:\xampp\ZendGuardLoader\php-5.4.x\ZendLoader.dll"
zend_loader.enable=1
Then restarted the xampp but it was giving php5.dll missing error then I downloaded php5.dll file from internet and uploaded to xampp/php folder and edited following file
xampp\apache\conf\extra\httpd-xampp.conf here I edited this line
LoadFile "/xampp/php/php5ts.dll"
to
LoadFile "/xampp/php/php5.dll"
then the php5.dll error gone and the following error occurred:
"the procedure entry point zend_new_interned_string could not be located in the dynamic link library E:\xampp\ZendGuardLoader\php-5.4.x\ZendLoader.dll"
When I tried to search on internet then found that this is the issue with 'Thread Safety' is enabled in xampp php. I don't know how to disable 'Thread Safety' or how to use 'Non Thread Safety' php version with xampp.
Please help me to install Zend Guard Loader on Windows 8 os Xampp 1.8.1 with php 5.4.x
Before you waste any more time checking, see if phpinfo() output shows that Thread Safety is enabled or not.
Zend Extensions are NTS (non thread safe) so if it is enabled, it cannot load and you need NTS PHP to load Guard Loader extension.
And
Thread Safety cannot be disabled, it is a compilation flag and how the compiled binary works.
You need to load a different Apache PHP Module which is non-thread-safe (php.net releases both TS and NTS builds).
Take a look to
http://forums.zend.com/viewtopic.php?f=57&t=43013
So, I had this same issue.
XAMPP (as far as version 3.2.1) comes bundled with Thread Safe PHP compilation. This is php binaries are compiled using a flag to force "Tread Safe", so, it can't be switched back on the same binaries.
You need to change the binaries of XAMP for those Non Tread Safe (NTS) compiled.
I followed this guide for replacing PHP in XAMP to use NTS. The guide explains how to enable FastCGI and Zend OPcache, so if you copy paste the steps, you should have XAMP run PHP on FastCGI mode. The relevant steps are:
Identify the version of Apache server that is running. [..]
Download the latest PHP binaries for windows. Choose the non-thread-safe (you might choose a newer version of php) [...] Create a new folder for the new version of PHP (ex. c:\xampp\php56-nts ).
Edit the Apache configuration file (ex: c:\xampp\apache\apache\conf\extra\ httpd-xampp.conf ) and replace the paths in the php5 module configuration you may need to change the name of the .dll
As php binaries downloaded from php.net can be used for developpment or for production, you need to create a php.ini according to your needs (there are 2 templates in the folder you can use to begin with: php.ini-development and php.ini-production )
With this, basically you have XAMPP to run PHP's NTS version. Afther that, you can install Zend Guard Loader as the guide says. Basically:
Download the Zend Guard Loader binary
Locate the ZendLoader.dll file and paste it inside the library path of php for xampp. Get the path.
Configure php.ini to use ZendLoader; Add
zend_extension=< full_path_to_ZendLoader.dll>
zend_extension=< full_path_to_opcache.dll>
Add any other optional configuration. Restart Apache and it should restart with the NTS version of PHP. You can test this with localhost/xampp/phpinfo.php

Zend Debugger - Wamp2.2 + Eclipse PHP

I am trying to get zend debugger woking with eclipse so that I can trigger breakpoints in my code.
I have installed wamp 2.2 (uses PHP 5.3.10 - thread safe)
I have installed the eclipse 'all in one' package from zend.
I have updated my php.ini to include
zend_extension = "c:/wamp/bin/php/php5.3.10/zend_ext/ZendDebugger.dll"
[Zend]
zend_debugger.allow_hosts="127.0.0.1"
zend_debugger.expose_remotely=always
When I launch my php.exe it shows
Cannot load Zend Debugger - it was build with configuration API220090626,NTS,VC9, whereas running engine is API2200090626,TS,VC9
I have read that ZendDebugger only works as non thread safe so I cannot just download a ts version. I cannot find a download link for php 5.3.10 (http://windows.php.net/download/)
However, when I try to replace my copy of php with 5.3.13 (nts) my sqlsrv extension is not compatible and I get the error
PHP Startup: Unable to load dynamic library 'c:wamp/bin/php/php5.3.10/ext/php_sqlsrv_53_nts.dll' - %1 is not a valid Win32 application
If I change my php.ini to not load the sqlsrv extension I still get the error
Failed loading c:/wamp/bin/php/php5.3.10/zend_ext/ZendDebugger.dll
Does anyone know how I can get debugging to work with Zend Framework, Eclipse, wamp and sqlserv?
Cannot load Zend Debugger - it was build with configuration API220090626,NTS,VC9, whereas running engine is API2200090626,TS,VC9
NTS means Not-Thread-Safe, and hence you must use a NTS build of PHP... Which is how you run PHP as a FCGI process (vs. Apache Thread via mod_php).
Zend does not usually provide or support TS builds of anything anylonger (since after PHP 5.2), and it looks like your setup is meant for a TS build...
You could try two things:
Use a WAMP that ships with PHP as FCGI (NTS) option (I know the latest version of Wamp-Developer does, but it's commercial, maybe see if XAMPP or another Wamp does?)
Or instead of ZendDebugger, try using XDebug. It comes both as TS and NTS builds. And I'm sure you can use Eclipse with it.

SAPRFC dll and PHP 5.5

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...

Categories