Zend Debugger - Wamp2.2 + Eclipse PHP - 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.

Related

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

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

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.

Can't install gmagick on Windows 7 XAMPP

I have XAMPP 1.8.1 with PHP 5.4.7 installed. When I add php_gmagick_ts.dll to my php.ini (I made sure that I need the ts and not the nts version), upon restarting Apache I'm getting these errors:
The procedure entry point php_checkuid_ex could not be located in the
dynamic link library php5ts.dll
and after that one:
PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_gmagick_ts.dll' - The specified procedure could not be found.
Any help?
AFAIK there is currently no GraphicsMagick DLL available working with PHP 5.4 on Windows.
As the availability of php_gmagick_(n)ts.dll for latest PHP versions is always a problem, I recommend that you either drop back to PHP 5.3 (DLLs available here) or that you use the standalone version of GraphicsMagick and call it from within PHP using exec() commands.

Installing php_svn.dll extension in the Zend Server CE

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.

Categories