问题
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
回答1:
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
回答2:
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
来源:https://stackoverflow.com/questions/25498377/how-to-install-zend-guard-loader-on-xampp