sh: zip: command not found

B

Bashed

Guest
Can't even post anything here because of an error telling me there's a "sneeky url" in my post which there isn't. How does anyone post here linux commands and paths, etc without this error message?
 
Last edited:


As a new member, you have to get a few "likes" before you can post URL's. This helps to keep spammers from signing up and posting links to their garbage. So here is one like for you... hang in there, you'll get others.

I think you should be able to post commands or paths to describe your problem. Start with telling us what distro you are using. What response do you get to a terminal command: which zip

Welcome to the community!
 
Hi,

I did not post any urls, not even "@" and I'm TRYING to post the paths, but it will not let me. The system is setup wrong and giving this false alarm about urls. Trust me, I know because I also run Xenfor and these particular anti-spam filters/modules. They need to fix the filter.

This is about 10% of my original post here...

Running Centos 6.6 VPS (OVZ) with Centos Web Panel.

Trying to run a Wordpress plugin, getting this in log file

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

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

It's already set to 5.4 PHP and zip is already compiled.

"You are running PHP version: 5.4.27"

[server ~]# which zip
/usr/sbin/zip
 
Follow up...


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

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

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

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] sh: zip: command not found

Code:
~]# yum install zip
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
----
Setting up Install Process
Package zip-3.0-1.el6.x86_64 already installed and latest version
Nothing to do


Code:
[root ~]# 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


It's already set to 5.4 PHP and zip is already compiled.

"You are running PHP version: 5.4.27"

Installed dependencies first too.

These are the flags which I already compiled.

Code:
./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

Code:
string(0) ""

I changed "zip" to "/usr/bin/zip" in the phpinfo.php file and the out come was:

Code:
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:
export PATH=$PATH:/usr/bin/zip
AND

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

but neither helped

I even ran this below, didn't fix it:
ln -s /usr/sbin/zip /usr/bin/zip

I also added this line in /usr/local/apache/bin/envvars and restarted apache, still no fix.

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

Also:

Code:
[root ~]# file /usr/bin/zip
/usr/bin/zip: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
Code:
[root ~]# file /usr/sbin/zip
/usr/sbin/zip: symbolic link to `/usr/bin/zip'
 
Hmmm, that's a bit of a head-scratcher.....
It looks like you have all of the pre-requisites in place, including the envvars for Apache.....

Rather than restarting Apache, have you tried manually stopping it and then starting it again? That should force the envvars to be reloaded when it is started up again.... I seem to recall that sometimes stopping and starting Apache worked better than simply restarting it.
But it has literally been years since I administered a LAMP server.

But that's about the only thing I can think of trying offhand!
 
Thanks @JasKinasis for jumping in. Maybe others can help with this also. The original post didn't have enough info, and then the following posts lost me quickly. I don't use CentOS, Apache, Perl, or Wordpress. Perhaps the questions would be better directed to forums more specific to the application(s) giving trouble. It vaguely seems like it might be a permission problem, but that is just a stab in the dark. Might "VPS" (Virtual Private Server?) be part of this problem?

Good luck @Bashed ! Hope you find a solution.

Cheers.
 
Why did you compile PHP manually but install zip via yum @Bashed. Its normally not a good idea to mix.
 

Members online


Top