Zend optimiser - Incompatible file format - php

I have an error while running my website which coded with PHP and uses zend optimiser on hostmonster shared hosting.
The issue appeared since I updated from PHP 5.2 to PHP 5.4.
Now when I try to use 5.2 the error is
"Zend Optimizer" is not installed on the Web Server and therefore cannot service encoded files
On PHP 5.4 the error is
Fatal error: Incompatible file format: The encoded file has format major ID 65535, whereas the Loader expects 5 in /home1/mylingui/public_html/admin/config/ProjectConfig.php on line 0
php.ini
zend_loader.disable_licensing=0
zend_extension=/usr/php/54/usr/lib64/php/modules/ioncube_loader_lin.so
zend_extension=/usr/php/54/usr/lib64/php/modules/ZendGuardLoader.so

From what I was able to figure out from the Zend forums, your file is encoded for the PHP 5.2 version of Zend Encoder. You need to ask your vendor for a version encoded for PHP 5.4
(http://forums.zend.com/viewtopic.php?f=57&t=112658)
HTH,
=C=
Manager of Training for Zend

Related

Laravel 5.4 does not supports PHP version 7.4.5

I am working on the application which is built on the laravel 5.4 framework. I have installed the latest version of PHP. which is
PHP Version 7.4.5
Actually I would like to know does PHP 7.4.5 supports laravel 5.4 app if no then why? and how can I downgrade the PHP version?
Also I am getting the error in php logs files ( [2020-05-15 12:37:08] local.ERROR:
ErrorException: Trying to access array offset on value of type null in
C:\xampp\htdocs\carehalo_mini\app\Helpers.php:392 )
Also, you can check out the code in the given screenshot Helpers.php:392 lines
app\Helpers.php this sounds like something part of the app you have and not related to Laravel. My best guess is that Laravel won't have any problems running on 7.4, but the same does not apply for the code written in the app. And of course, best thing to do would be to upgrade your Laravel version to at least 6 regardless of working or not.
You can fix your Error by changing line 392 to:
if(empty($admin) || ($admin->token != Session::get('token'))

Failed installation of zend-escaper with Composer

I'm trying to install zend-escaper but I'm getting this error:
This is strange as my PHP version (from phpinfo()) is 5.5.19, the message claims it is 5.3.5(!) which should satisfy the requirement anyway.
My ZF version is 1.12.13
I'm using PHP Storm
Can anyone help please?
Thanks
Tomasz
The PHP version on the command line can be a different executable than the PHP running inside the web server. It also can use a different pho.ini configuration file.
So if Composer states the PHP it is using is 5.3.5, this is correct because Composer is directly asking the PHP it is running on for its version. The problem is when this PHP version on the command line is way older then the PHP version in the web server.
Try to update your command line PHP.
Some more things to say: the version 5.3.5 is lower than the required 5.3.23, because the last number in the version is 5 compared with 23, and 5 is less than 23. So the version you are using is below the minimum requirement for zend escaper - at least in the version 2.5.1 you try to use. Such an old PHP was last supported in the 2.2 framework versions, so you might as well try to depend on ~2.2. However this will simply be a workaround for the old cli version.
One other note: You are in the process of installing a zend framework 2 component - don't expect your installed zend framework 1 to support any fancy stuff on its own. It is possible to mix classes with namespaces and without, and even use zf2 things together with zf1, but zf1 won't offer any automatic functionality to use these.

Where do I find a copy of Zend PHP Debugger for PHP 5.4?

I'm trying to find a copy of the Zend debugger for PHP 5.4.
I've followed the various tutorials on the web telling me to download the Studio Web Debugger from the zend website, but unfortunately it only contains the binaries for PHP 5.3 (and below). I can't seem to find any mention anywhere of the Zend Debugger for PHP 5.4 ... it seems like they no longer make it and instead want you to use their full Server product instead.
Amazingly, Zend, "The PHP Company", will sell you Zend Studio, but they will not package a 5.4 version of the Studio Debugger in the related download. I would think they could get an updated version out since 5.4 has been released for over a year...
In any event, a work around has been making the rounds on the Internets.
Here is a full set of instructions for a Debian based system.
It was based largely on this Zend Forum post...
http://forums.zend.com/viewtopic.php?t=47568&f=59#p148893
The gist is to lift a 5.4 debugger file from an old Zend Server download an use it instead.
Many thanks to the original posters.
I had the same problem - however recent versions of the debuggers for php 5.3.x and php 5.4.x are included in the free version of Zend Server, so you can install that, make a copy of the .dll or .so that you need, and then uninstall it.
I did this to get at a version of ZendDebugger.dll that would work with php 5.3 and Zend Studio 10, but there is a 5.4 version of Zend Server aswell.

Any way to get Zend Guard Loader (php 5.3) to execute scripts protected with zendenc52.exe

Currently PHP 5.3 hosting environments have to install and use "Zend Guard Loader" extension to process and execute Zend Guard encoded files. I was unable to make it execute files that were encoded for use with Zend Optimizer (PHP 5.2).
Any workaround for this?
I don't think so... I am also stuck with using php 5.2 because of that.
If you want to run zend encoded 5.2 scripts using "Zend Guard Loader", you will need to fork out more money and buy the new version to encode the scripts again.... sad.
The only way that worked for me was to include php 5.2 file instead of Zend Guards message that is displayed when no zend guard loader found with if condition checking php version. Dirty, but working, yet 2 files still required to be present, but no need to have loader switching them in unprotected code.
To answer the Encoding vs. Runtime in Zend Guard/Optimizer/Loader context - they should perfectly match. The accepted answer is incorrect - there is no tweak to execute PHP 5.3 encoded files in Optimizer loaded in PHP 5.2.
Maintaining 2 target versions is very easy if you script / batch your encoding process when you have code updates. You just execute your source encoding once with zendenc52 and then with zendenc53, giving them different target directories.
More about that. PHP 5.3 code is different from 5.2, and you should actually have 2 different branches for your sources matching those versions.
Old News: http://php.net/manual/en/migration53.php
When testing / staging a Zend Guard encoded application, make sure you test the encoded version (and debug the open sources of course as needed). The reason is simple - encoded files have some overhead of data tables which handles obfuscation, and might change PHP functionality with some advanced PHP syntax. If any issue is found in encoded files while testing - it is easy to locate and fix the source. If you test only the source version and then encode and deploy to your customers - result is unpredictable.
As for deployment, when you install/untar/git/svn deploy your PHP files, you can either stick the PHP target version to your releases / downloads / code pushes, so they install in the correct version, or deploy 2 versions in different document root locations, and you can symlink / rewrite to the correct Guarded application version matching the PHP target version 5.2 or 5.3.
Last but not least. The supported runtime for Zend Guard is Zend Server. It has a community edition and anyone can install it free of charge (or purchase licensed components if needed extra boost and monitoring) on supported OSs, via native package managers for DEB / RPM or installation file (Windows, Mac, Other Linuxes not supported with native package managers). Zend Server optional Loader component will handle the encoded application files, and it comes with PHP 5.2 and 5.3 branches, so there is no need to manually install Zend Optimizer or Loader on your PHP. Upgrade from PHP 5.2 to 5.3 is easy and native when applications (encoded and open source) were properly migrated.
Hope this helps.

Symfony installation problems

I'm trying to set up Symfony on my 64-bit Vista laptop that's using Zend Server CE for an all-in-one PHP stack. I'm trying to configure it with Netbeans as the IDE but I keep getting an error when I try to create a Symfony project; I've pointed it to my PHP.exe file located in C:\Program Files (x86)\Zend\ZendServer\bin\php.exe and my symfony.bat located in C:\Users\Wayne\Frameworks\symfony\data\bin\symfony.bat. Netbeans gives me a generic "Cannot create symfony project" error, so I tried to check it manually and create the project. This gives me an error call to undefined function token_get_all(), which seems to reference the built-in tokenizer for PHP 5. Checking my PHP extensions in Zend, tokenizer is enabled and the php_tokenizer.dll is where it should be, so I'm not sure why this isn't working right.
Any ideas? I'll gladly provide more information if necessary. I'm using the latest version of Zend Server CE with PHP 5.3.2, so tokenizer should be working fine.
Keep in mind that the CLI and the webserver may use different php.ini files. Do a php -i > info.txt to check the CLI's settings (including the .ini file it uses).

Categories