16
2
How is this possible?
bash: /usr/local/phantomjs/bin/phantomjs: No such file or directory
bash-4.3# cd /usr/local/phantomjs/bin
bash-4.3# ls
phantomjs
bash-4.3#
The content of /usr/local/phantomjs/bin
is the phantomjs
file but when I try to execute it, it looks like it does not exist.
FYI, I'm on Alpine linux 3.3
Update1
bash-4.3# ls -lF /usr/local/phantomjs/bin/phantomjs
-rwxr-xr-x 1 root root 67932064 Jan 25 2016 /usr/local/phantomjs/bin/phantomjs*
bash-4.3# lf -lF /usr/local/phantomjs/bin
bash: lf: command not found
bash-4.3# ls -lF /usr/local/phantomjs/bin
total 66340
-rwxr-xr-x 1 root root 67932064 Jan 25 2016 phantomjs*
Update2
bash-4.3# file /usr/local/phantomjs/bin/phantomjs
bash: file: command not found
bash-4.3# head -n1 /usr/local/phantomjs/bin/phantomjs
ELF>xvA@`�
Q�t/lib64/ld-linux-x86-64.so.2GNUGNU����!�`�L`�L^|��������h�TT@T@DD`��`�L`�P�tddB�dB�dB��g
Update3
bash-4.3# echo $PATH
/usr/local/phantomjs/bin:/usr/local/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
bash-4.3# ruby -v
ruby 2.1.10p492 (2016-04-01 revision 54464) [x86_64-linux]
Update4
bash-4.3# strace /usr/local/phantomjs/bin/phantomjs
execve("/usr/local/phantomjs/bin/phantomjs", ["/usr/local/phantomjs/bin/phantom"...], [/* 13 vars */]) = -1 ENOENT (No such file or directory)
writev(2, [{"strace: exec: No such file or di"..., 39}, {"\n", 1}], 2strace: exec: No such file or directory
) = 40
writev(2, [{"", 0}, {NULL, 0}], 2) = 0
getpid() = 12
exit_group(1) = ?
+++ exited with 1 +++
Thanks
Let's see the output of
ls -lF /usr/local/phantomjs/bin/phantomjs
as well aslf -lF /usr/local/phantomjs/bin
. Please [edit]. – a CVn – 2017-02-07T13:12:37.0101Oops. Yes, I really did mean
ls -lF
. Sorry for the confusion! Can we also see the output offile /usr/local/phantomjs/bin/phantomjs
please, and if that says anything like "text" or "script", alsohead -n1 /usr/local/phantomjs/bin/phantomjs
. I have a hypothesis, and that would potentially confirm or falsify it (or at the very least point us in the right direction). – a CVn – 2017-02-07T13:50:04.1931
Okay, not what I expected, but helpful. Since you have
– a CVn – 2017-02-07T13:59:41.540ls
but notfile
immediately available, I now suspect that your$PATH
is not fully populated. Let's seeecho $PATH
to confirm that; I suspect it will include/bin
but not/usr/bin
, for starters. It's also possible that other parts of your environment (such as$LD_LIBRARY_PATH
) are incomplete for the same reason that causes$PATH
to be incomplete, but$PATH
is easy to verify at a glance. Looking at https://en.wikipedia.org/wiki/Alpine_Linux, Alpine's minimalism might be a factor here.see Update3. FYI
ruby
works as expected. The issue is only withphantomjs
. – Sig – 2017-02-07T14:03:54.370Okay, this is actually odd. Hopefully someone will be able to take the details thus found and actually describe the behavior seen, because I am running out of ideas to try at the moment. – a CVn – 2017-02-07T14:48:32.183
It is compiled Python and is purportedly self-contained, but "relies on Fontconfig (the package fontconfig or libfontconfig, depending on the distribution." A clue? no idea! http://phantomjs.org/download.html
– Yorik – 2017-02-08T21:27:36.820Please provide the output of
uname -m
andfile /usr/local/phantomjs/bin/phantomjs
. I know this confusing behavior, when you try to run a binary compiled for a different cpu architecture than that of the current machine. How did you installed / obtained thephantomjs
binary? – mpy – 2017-02-08T21:48:37.793Ok, I've seen right now, you don't have
file
installed, but the headline identifies the binary as a x86_64 executable already. – mpy – 2017-02-08T21:52:30.283If you are getting this from running a Go program please see this https://stackoverflow.com/questions/34729748/installed-go-binary-not-found-in-path-on-alpine-linux-docker
– Alex Punnen – 2019-08-09T06:06:00.493