0

Centos 6.6 64bit on OpenVZ VPS.

I tried a phpinfo.php file using only the following code:

<?php
var_dump( exec('zip -r domains.zip "domains"') );
// phpinfo();
?>

.

The php error log is now: [Sat Jul 04 17:44:27 2015] [error] [client xxx.xxx.xxx.xxx] sh: zip: command not found

.

[root@server ~]# yum install zip
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.atlanticmetro.net
 * extras: mirror.trouble-free.net
 * rpmforge: repoforge.mirror.constant.com
 * updates: mirror.cogentco.com
Setting up Install Process
Package zip-3.0-1.el6.x86_64 already installed and latest version
Nothing to do

.

[root@server ~]# php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
ionCube Loader
json
libxml
mbstring
mcrypt
mysql
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
soap
sockets
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib

.

[root@server ~]# php -v
PHP 5.4.27 (cli) (built: Jul  3 2015 18:06:21) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v5.0.11, Copyright (c) 2002-2015, by ionCube Ltd.

MORE INFO

I want to add /usr/bin/zip to the executable path for the web server.

I've tried:

export PATH=$PATH:/usr/bin/zip

AND

cd /usr/bin sudo ln -s /usr/bin/zip zip

But neither one worked.

Cazzette
  • 63
  • 1
  • 11

1 Answers1

1

Just so I can make it an actual answer so this can be marked solved:

After running which zip and locating zip, /usr/bin/zip triggered successfully while zip did not.

As for the new part: I'd personally store it as a PHP variable (like $zip = /usr/bin/zip) and call it if that solves it. There may be a better solution.

Michael Bailey
  • 462
  • 2
  • 12
  • Hi @Michael Bailey. It's not my software to modify, it's obfuscated. So I cannot edit it's own files like that unfortunately. – Cazzette Jul 06 '15 at 00:01
  • can you clarify this php variable? I'd like it web server wide, so somewhere within php.ini I assume. What would this line look like? I don't want to screw this up. – Cazzette Jul 06 '15 at 00:34
  • I just mean a lot of PHP web apps have a header.php that they include in all their pages. Kinda a non-answer. – Michael Bailey Jul 06 '15 at 01:05