When running scripts that are protected with Zend encoded framework it is necessary to install a decoder such as Zend Guard Loader. If you are running CentOS 6 server and need the extra protection that SE-Linux provides in a production environment this should get your ZendGuardLoader extension running for your previously installed Apache 2 webserver and Php 5.3.3 webserver.
1. Download package:
# wget http://downloads.zend.com/guard/5.5.0/ZendGuardLoa...
2. Extract the Zend Loader package.
# tar xzvf ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz
3. Locate and copy the ZendGuardLoader.so that corresponds to the installed Php version into the proper directory.
# cp ZendGuardLoader-php-5.3-linux-glibc23-x86_64/php-5.3.x /usr/lib64/php/modules/
4. Create a file called ZendGuard.ini within the /etc/php.d directory where all the other php associated .ini files live.
# nano /etc/php.d/ZendGuard.ini
Paste the lines below into the newly created ZendGuard.ini file:
; Enable Zend Guard extension
zend_extension=/usr/lib64/php/modules/ZendGuardLoader.so
zend_loader.enable=1
5. Restart your Web server.
# /etc/init.d/httpd restart
IMPORTANT: After restart Apache, and executing php -v you may get error messages like “Failed loading /usr//lib64/php/modules/ZendGuardLoader.so
: /usr/lib64/php/modules/ZendGuardLoader.so: cannot restore segment prot after reloc: Permission denied”.
You will need to execute like this to fix the SE-Linux permissions - just change the correct path to SO files.
1. # chcon -t texrel_shlib_t /usr/lib64/php/modules/ZendGuardLoader.so
2. # execstack -c /usr/lib64/php/modules/ZendGuardLoader.so
Run #php –v again and if you don’t get any errors, problem is solved. In some cases also SE-Linux can create problems, we sometimes have to disable it.
1. Download package:
# wget http://downloads.zend.com/guard/5.5.0/ZendGuardLoa...
2. Extract the Zend Loader package.
# tar xzvf ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz
3. Locate and copy the ZendGuardLoader.so that corresponds to the installed Php version into the proper directory.
# cp ZendGuardLoader-php-5.3-linux-glibc23-x86_64/php-5.3.x /usr/lib64/php/modules/
4. Create a file called ZendGuard.ini within the /etc/php.d directory where all the other php associated .ini files live.
# nano /etc/php.d/ZendGuard.ini
Paste the lines below into the newly created ZendGuard.ini file:
; Enable Zend Guard extension
zend_extension=/usr/lib64/php/modules/ZendGuardLoader.so
zend_loader.enable=1
5. Restart your Web server.
# /etc/init.d/httpd restart
IMPORTANT: After restart Apache, and executing php -v you may get error messages like “Failed loading /usr//lib64/php/modules/ZendGuardLoader.so
: /usr/lib64/php/modules/ZendGuardLoader.so: cannot restore segment prot after reloc: Permission denied”.
You will need to execute like this to fix the SE-Linux permissions - just change the correct path to SO files.
1. # chcon -t texrel_shlib_t /usr/lib64/php/modules/ZendGuardLoader.so
2. # execstack -c /usr/lib64/php/modules/ZendGuardLoader.so
Run #php –v again and if you don’t get any errors, problem is solved. In some cases also SE-Linux can create problems, we sometimes have to disable it.
Topics:
computers, servers, linux, centos 6, zend optimizer, zend guard loaders, apache 2, php 5.3
- ·
- Report
- ·
- July 27, 2013 1:23 pm
All times are GMT -8. The time now is 12:45 pm.