I've got an error

Home / FAQs / I've got an error

I've got an error

1. Got '....parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' [2] - PHP 4.3 compiler error...'
It seems your code is not compatible with PHP 4. Please turn off encoding for PHP 4 by deselecting the PHP 4 checkbox in your project settings. If you do not need to encode for PHP 4 but encoding for PHP 4 is on by default when you create a new project, you may change default settings in application preferences

2. I'm getting 'unable to execute ./sgencoder: No such file or directory' in Linux
If you get the above error message on Linux but you are pretty sure that permissions are correct and the execution bit is set, this error is caused by some missing 32-bit libs on a 64-bit machine. Unfortunately, Linux is not very informative in its error messages in this case. Please install 32-bit compatibility libs. If you use Ubuntu/Debian you may do it by running the following command from console:
apt-get install ia32-libs
SourceGuardian for Linux is available both as 32-bit or 64-bit application. You may use 32-bit version but need to install the above compatibility libs. Protected files may be run on 32-bit or 64-bit. Installing the above package is required only for running 32-bit version of the encoder on a 64-bit machine. Loaders differ for 32-bit and 64-bit and do not require installing additional packages.

3. I use version 7 of SourceGuardian. After upgrading PHP to version 5.3 my encrypted files do not work anymore
Encoding for PHP 5.3 is supported in version 8 of SourceGuardian and newer. If you are using version 7 or older than you may upgrade your copy of SourceGuardian in the user profile.   It's also important to install the latest loader for PHP 5.3. Please find loaders in the version 8 installation package. You may also use our loader assistant to know the loader you need and how to install it http://sourceguardian.com/loaders/download.php

4. Why do I see my PHP code source when run the encoded version?
Your code probably use short PHP tags <? ?>. Enable short PHP tags support in Advanced settings in your SourceGuardian project or use --short-tags option if you prefer to run the encoder from the command line. Re-encode your files.

5. I'm getting "Internal Error: Failed to expand shell folder constant "userdocs" from the installer.
While installing SourceGuardian on Windows Vista, during the installation the following error occurs with the message: "Internal Error: Failed to expand shell folder constant "userdocs" following "Setup was not completed. Please correct the problem and run Setup again"
This problem is caused from a Vista conflict.
Set the folder "my documents" to its default values.
1. Right Click on Start
2. Select Explore from the Menu
3. Right Click on the "My Documents" Folder
4. Click on Properties and it will open up the Document Properties Dialog box
5. Click on the General Tab, this should be the default
6. You will see a small box "Read only" at the bottom next to Attributes - click on this box to untick /de-select this option
7. Click on the Apply button
8. Click on Ok to close the Document Properties dialog and save the changes.
Setting back the default value for "My documents" is just a workaround,which usually fixes the default read/write rights for the "MyDocuments" folder.
Try installing SourceGuardian again.

6. Automatic upgrade fails on Windows with 'Update error: Unable to extract the update to: C:/Program Files (x86)/SourceGuardian'
If you are running SourceGuardian on Windows 7, 8  or newer and getting the 'Update error: Unable to extract the update to: C:/Program Files (x86)/SourceGuardian' error message during automatic update,
please run the application under administrative account as otherwise the files can't be extracted to the installation folder because of Windows restrictions.

7. SourceGuardian 11 - Protected script's header is broken
If you are using version 11 of SourceGaurdian and getting the error 'SourceGuardian Loader - Protected script's header is broken. Probably the encoded file was modified. Please install an original unmodified file or contact the author of the script to get the original file. Error code [10]', UPDATE THE LOADER. 
Please download and install the recent loader from https://www.sourceguardian.com/loaders/ or use the loader assistant https://www.sourceguardian.com/loaders/download.php

8. SourceGuardian Loader - This protected script does not support version x.y.z of PHP
 A problem is that the protected script was not encoded for that version of PHP. Protected scripts include different versions of bytecode for the major versions of PHP selected during encoding. If you need to run the protected file on the newer version of PHP, it is not enough to install a new loader to the target machine. You also need to re-encode the file from source using the recent version of SourceGuardian and in the encoding project select new versions of PHP that you need to support for your code.

9. Using the 'sgencoder' CLI encoder on Mac fails with 'image not found'
If you are trying to run the symlinked CLI encoder from the GUI installation on Mac, it will probably fail with the following error message when doing the actual encoding: 
sgencoder4.bundle: dlopen(s/sgencoder4.bundle, 5): image not found
This happens because the CLI executable can't find the required bundles. Add the following line to your ~/.profile and restart the Terminal. The line below presumes you installed SourceGuardian GUI to Applications. For other installation paths, please change the line accordingly.
export DYLD_LIBRARY_PATH="/Applications/SourceGuardian.app/Contents/MacOS:$DYLD_LIBRARY_PATH"

10. Got a problem running the encoder on Windows because of missed libs?
Encoder DLLs for different versions of PHP depend on different standard libraries on Windows. We include the required redistribution pack to the installer but if running of it was cancelled or if another issue had happened during SourceGuardian installation, this might result in missing some of the required standard libraries. In that case the below information may help and you may find and install the missed libraries to your Windows machine.
sgencoder71.dll for PHP 7.1 and DLLs for earlier versions of PHP depend on the following libs:
sgencoder72.dll for PHP 7.2 dependencies:
sgencoder73.dll for PHP 7.3 dependencies:
Encoder for PHP 7.2 and 7.3+ require UCRT Microsoft package to be installed as well as Microsoft Visual C++ 2015 or 2017 redistributable. 

11. I am getting Code 19 at the end of encoding process...
The code 19 "directory" on encoding is not an error, it's an indication of copying of an empty folder to the target directory. Time ago we were asked by other customers to include copying of empty folders if they exist in the source and if the target folder is specified. This is to fully reproduce the project directory tree during encoding and include empty folders.

If you check the encoding log, it includes "directory" explanation text for that line.

Since it's a folder we don't count it as an encoded file. Also since it's not an error, we don't count it as an error either. So, ignore code 19 since it's not an error.

12. GUI is not staring on Linux
The recent version 13 of SourceGuardian includes GUI that we reworked with Qt5. That was a serious change and Qt5 apps depend on much more shared libraries. GUI for Linux was build on Debian 10 and must work on it and newer releases of Debian or Ubuntu. It must also work on other modern Linux distros. Sorry, but we did not get a chance to test GUI on other Linux distros or older versions.
If SourceGuardian GUI does not start on your Linux, it's very likely that your system is missing some of the required shared libs. In this case, you may use two commands below to try to know what libs are missed and then either email us or try to install them.  Run Terminal app and cd to SourceGuardian installation folder:
> ldd ./SourceGuardian | grep "not found"
if the above command produces no results, try this:
> QT_DEBUG_PLUGINS=1 ./SourceGuardian
If any shared libs are missed, you may read about it in the console. Please let us know and we can add them to the application package. 
If you need a quick solution for running GUI, you may also try this and install Qt5. (package name and package manager may differ on your Linux)
sudo apt-get install qt5-default
And finally you may download the CLI version of SourceGuardian which has much less shared libs dependencies or use the CLI version included within GUI in the "bin" subfolder.
Below is a quick update to this FAQ which may help.

If you are not using Ubuntu or Debian or they are not the recent, libcurl4 may be missed. You will see it's missed by running ldd on the executable as described above. If this is the case, please install libcurl4
Ubuntu/Debian: sudo apt-get install libcurl4
CentOS: sudo yum install libcurl
All the Qt5 shared libs are included and you may find them in the "lib" subfolder within the installation folder. But if you are getting a message about missed libQt5Core etc, it means your OS is ignoring relative paths to the shared libs as they are set within the executable. In this case you may try running the encoder GUI with the following command or modify RUNME.sh or create your own shell script:

cd /path/to/sourceguardian/folder
LD_LIBRARY_PATH=/path/to/sourceguardian/folder/lib ./SourceGuardian  
(please change the path to the actual path where the application is installed)

13. VCRUNTIME140.dll error on Windows
If you are getting a problem encoding for PHP 8 or 8.1 on WIndows and getting an error about  'VCRUNTIME140.dll', it means the Microsoft VC Redistributable packages are not installed on your machine or outdated. This package is included with SourceGuardian and is installed by default but there may be version check issues etc which made it not installed or not updated. 
PHP Warning: 'C:\WINDOWS\SYSTEM32\VCRUNTIME140.dll' 14.13 is not compatible with this PHP build linked with 14.28 in Unknown on line 0

In this case please download the VC Redistributable installer from Microsoft. Use the links on the top of the page which mention Visual Studio 2017. You need to download and install the 32-bit version regardless if your windows is 32 or 64-bit. 

this is a direct download link (if it does not work, use the link above)
After installing, reboot and then start SourceGuardian and try encoding again.

14. libjpeg.so.* is missed in Linux when running GUI
Install the missed library:
sudo apt-get install libjpeg62
This error may appear on Ubuntu version 12.04 and later, where this library is not installed by default, as it was in earlier versions.

php encoder Buy Now


Take a Tour!

Check out the features and benefits of SourceGuardian
Find out more
Try our free php source code demo
Account Login:

login Forgotten Password?
Connect with us
facebook linkedin twitter rss
© Copyright 2002 - 2022 SourceGuardian Limited
Privacy Policy l Terms & Conditions l Company Info l Contact us l Sitemap l PHP Weekly News