Author Topic: sh: zip: command not found  (Read 11919 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
sh: zip: command not found
« on: July 04, 2015, 08:56:01 PM »
Trying to run a Wordpress plugin, getting this in log file

How do I correct this? It appears zip module is already installed as a dependency by default.

Offline
*
Re: sh: zip: command not found
« Reply #1 on: July 04, 2015, 10:40:08 PM »
This is not related to the plugin apparently.

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

Code: [Select]
<?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
« Last Edit: July 04, 2015, 10:59:37 PM by Bashed »

Offline
*
Re: sh: zip: command not found
« Reply #2 on: July 04, 2015, 10:43:06 PM »
[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



Offline
*
Re: sh: zip: command not found
« Reply #3 on: July 04, 2015, 11:00:06 PM »
if you are using php selector then you need to check the php version which you are using for zip extension
AntiDDoS Protection (web + mail)
http://centos-webpanel.com/website-ddos-protection-proxy

Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp


Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor


Do you need Fast and FREE Support included for your CWP linux server?
http://centos-webpanel.com/noc-partner-list
Installation Instructions
http://centos-webpanel.com/installation-instructions
Get Fast Support Here
http://centos-webpanel.com/support-services

Offline
*
Re: sh: zip: command not found
« Reply #4 on: July 05, 2015, 12:04:48 AM »
if you are using php selector then you need to check the php version which you are using for zip extension

Confused what you mean. It's already set to 5.4 PHP and zip is already compiled.  I included that output in my previous post.

 You are running PHP version: 5.4.27

Installed dependencies first too.

These are the flags which I already compiled.

Code: [Select]
./configure
--prefix=/opt/alt/php54/usr
--with-zlib
--enable-soap
--enable-exif
--with-config-file-path=/opt/alt/php54/usr/php
--with-config-file-scan-dir=/opt/alt/php54/usr/php/php.d
--enable-phar
--enable-bcmath
--enable-calendar
--with-curl
--with-iconv
--with-mysql
--with-mysqli
--with-mysql=mysqlnd
--with-mysqli=mysqlnd
--with-mcrypt
--with-gettext
--with-xsl
--with-xmlrpc
--with-pdo-mysql=mysqlnd
--enable-posix
--enable-ftp
--with-openssl
--enable-mbstring
--with-jpeg-dir=/usr
--with-freetype-dir=/usr
--with-kerberos
--with-xsl
--with-bz2
--enable-sockets
--enable-zip
--with-gd
--with-imap
--with-imap-ssl
--enable-sockets
--with-pcre-regex
--libdir=/usr/lib64
--with-mysql-sock=/var/lib/mysql/mysql.sock

Output of phpinfo.php ends up being

string(0) ""
« Last Edit: July 05, 2015, 12:06:52 AM by Bashed »

Offline
*
Re: sh: zip: command not found
« Reply #5 on: July 05, 2015, 07:03:13 PM »
I changed "zip" to "/usr/bin/zip" and the out come was:

Code: [Select]
string(42) "updating: domains/xxxxxx.co/ (stored 0%)"
Now, how do I do change this in the VPS so that path is always defined and able to be called by any script without having to manually define the full path?

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

I've tried:

Code: [Select]
export PATH=$PATH:/usr/bin/zipAND

Code: [Select]
cd /usr/bin
Code: [Select]
sudo ln -s /usr/bin/zip zip
but neither helped

Re: sh: zip: command not found
« Reply #6 on: July 05, 2015, 07:44:02 PM »
ln -s /usr/bin/zip /usr/sbin/zip

Offline
*
Re: sh: zip: command not found
« Reply #7 on: July 06, 2015, 12:05:45 AM »
Didn't work unfortunately.

It's not my software to modify it's path internally too, it's obfuscated. So I cannot edit it's own files like that unfortunately.


I ran

ln -s /usr/bin/zip /usr/sbin/zip

Back to

[Sun Jul 05 18:58:19 2015] [error] [client xxx.xxx.23.22] sh: zip: command not found


My simple goal here:
I need to be able to call the command zip from within a PHP script without having to use the direct path /usr/bin/zip because it's out of my control to edit every single plugin needing zip access and modify their path.
« Last Edit: July 06, 2015, 01:24:32 AM by Bashed »

Offline
*
Re: sh: zip: command not found
« Reply #8 on: July 06, 2015, 09:28:19 PM »
Really need help here please.

This is what the script developer said about the particular WP plugin:

Quote
Please note the following major requirements of WP Twin:
- system() and exec() PHP functions should be allowed to run on the server.
- zip, unzip, mysql, mysqldump, grep, and sed have to be available commands on the server.
- The UID that scripts run under has to have rights to write files. (We have a test file that can confirm the UID and the commands above)
- The mySQL database user has to have FULL rights to the database.

The thing is, disable_functions in php.ini is blank anyway.

I ran a test file they gave me:

Results.


WPTwin Test File

UID:

cURL: cURL is installed

ZIP and MYSQLDUMP:
MySql Dump Path:
MySql Path:
zip Path:
unzip Path:
grep Path:
sed Path:

Notice: Undefined index: t in /home/---/public_html/wptwintest.php on line 39

Offline
*
Re: sh: zip: command not found
« Reply #9 on: July 07, 2015, 05:43:37 AM »
you will need to check this issue with your system admin or cwp support
AntiDDoS Protection (web + mail)
http://centos-webpanel.com/website-ddos-protection-proxy

Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp


Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor


Do you need Fast and FREE Support included for your CWP linux server?
http://centos-webpanel.com/noc-partner-list
Installation Instructions
http://centos-webpanel.com/installation-instructions
Get Fast Support Here
http://centos-webpanel.com/support-services