zmfix: error while loading shared libraries: libswscale.so.2

Forum for questions and support relating to the 1.24.x releases only.
Locked
chrisp
Posts: 10
Joined: Sun Nov 22, 2009 8:12 pm

zmfix: error while loading shared libraries: libswscale.so.2

Post by chrisp »

Hi All,

I've created a CentOS VM and built ZoneMinder from source, but I'm not quite there yet... I took the relevant parts from this article, to do the build. After a couple of failed attempts, I ended up compiling with the following uptions: -

Code: Select all

ZoneMinder-1.24.4# ./configure --with-webdir=/var/www/html/zm --with-cgidir=/var/www/cgi-bin ZM_SSL_LIB=openssl --with-ffmpeg=/usr/local/share/ffmpeg CPPFLAGS="-D__STDC_CONSTANT_MACROS"
This is my system detail: -

Code: Select all

# uname -a
Linux centos.hq.rainbow-it.net 2.6.32-71.29.1.el6.i686 #1 SMP Mon Jun 27 18:07:00 BST 2011 i686 i686 i386 GNU/Linux

# cat /etc/redhat-release 
CentOS Linux release 6.0 (Final)
I'm having some problems starting the service(s): -

Code: Select all

# service zm start
Starting ZoneMinder: 08/13/2011 21:36:04.468277 zmpkg[1915].INF [Command: start]
Aug 13 21:36:04 centos zmpkg[1915]: INF [Command: start]
/usr/local/bin/zmfix: error while loading shared libraries: libswscale.so.2: cannot open shared object file: No such file or directory
[FAILED]
While this is happening, I see these lines in /var/log/zm/zmpkg.log: -

Code: Select all

08/13/2011 21:36:05.738210 zmpkg[1915].ERR [Unable to run "sudo -u apache /usr/local/bin/zmfix", output is ""]
and /var/log/messages: -

Code: Select all

Aug 13 21:36:05 centos zmpkg[1915]: ERR [Unable to run "sudo -u apache /usr/local/bin/zmfix", output is ""]
The library does exist though: -

Code: Select all

# locate libswscale.so.2 
/home/chrisp/ffmpeg/libswscale/libswscale.so.2
/usr/local/lib/libswscale.so.2
/usr/local/lib/libswscale.so.2.0.0

# ls -l /usr/local/lib/libswscale.so*
lrwxrwxrwx. 1 root     19 Aug 13 17:47 /usr/local/lib/libswscale.so -> libswscale.so.2.0.0
lrwxrwxrwx. 1 root     19 Aug 13 20:53 /usr/local/lib/libswscale.so.2 -> libswscale.so.2.0.0
-rwxr-xr-x. 1 root 252040 Aug 13 17:47 /usr/local/lib/libswscale.so.2.0.0

# file /usr/local/lib/libswscale.so* 
/usr/local/lib/libswscale.so:       symbolic link to `libswscale.so.2.0.0'
/usr/local/lib/libswscale.so.2:     symbolic link to `libswscale.so.2.0.0'
/usr/local/lib/libswscale.so.2.0.0: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped
ZoneMinder is configured to look in that directory: -

Code: Select all

# grep ZM_PATH_LIB /usr/local/etc/zm.conf
ZM_PATH_LIB=/usr/local/lib
I am at a loss to how to fix this.

Also, when surfing to the GUI, I get a blank page and the following error in my VirtualHost error_log: -

Code: Select all

[Sat Aug 13 21:56:51 2011] [error] [client 10.6.8.55] PHP Parse error:  syntax error, unexpected $end in /var/www/html/zm/includes/functions.php on line 2393
I'm not sure if this is related to my zmfix problem or not.

I look forward to any help you can provide.

Cheers,
--

ChrisP
vinodtcr
Posts: 18
Joined: Fri Feb 25, 2011 2:37 pm
Location: India

Re: zmfix: error while loading shared libraries: libswscale.

Post by vinodtcr »

Its because of incorrect module version reference... so run the given below commands as root.

# cd /lib/
# ln -s /usr/local/lib/libswscale.so.0
# ln -s /usr/local/lib/libavfilter.so.2
.... repeat the same for each error with the file name in error message...
tetepppp
Posts: 3
Joined: Sun Aug 21, 2011 6:24 am

Re: zmfix: error while loading shared libraries: libswscale.

Post by tetepppp »

Hi,

I am new with Linux. I was trying installing zoneminder on Centos 6. I am following the guide in the wiki. However when I try to start ther service I got the same error message:

[root@WEBSRV lib]# service zm start
Starting ZoneMinder: /usr/local/bin/zmfix: error while loading shared libraries: libswscale.so.2: cannot open shared object file: No such file or directory

In /usr/local/lib/ I see these files

[root@WEBSRV lib]# ls -l /usr/local/lib/libswscale.so*
lrwxrwxrwx. 1 root root 19 Aug 21 10:09 /usr/local/lib/libswscale.so -> libswscale.so.2.0.0
lrwxrwxrwx. 1 root root 19 Aug 21 10:09 /usr/local/lib/libswscale.so.2 -> libswscale.so.2.0.0
-rwxr-xr-x. 1 root root 259200 Aug 21 10:09 /usr/local/lib/libswscale.so.2.0.0

I have tried to run the command as vinodtcr recommended:
# cd /lib/
# ln -s /usr/local/lib/libswscale.so.0
# ln -s /usr/local/lib/libavfilter.so.2

Then try to start the service again but same error message occured.

Looking forward for help.
Thanks in advance.
jbmia
Posts: 50
Joined: Sat Jul 30, 2011 1:56 pm

Re: zmfix: error while loading shared libraries: libswscale.

Post by jbmia »

Did you take a close look at your config log after running configure? I had issues building on Fedora where configure was set up improperly effectively causing it to look for ffmpeg files twice.. so it found them and also didn't find them and then complained that it didn't find them.. May or may not be related, but do search over your config.log to see if you have any errors related to this file there.

I actually had to go into configure.ac and change the way configure runs to solve my problem...

jbmia
tetepppp
Posts: 3
Joined: Sun Aug 21, 2011 6:24 am

Re: zmfix: error while loading shared libraries: libswscale.

Post by tetepppp »

Oo sorry my mistake

I didn;t run ldconfig. Now the the service can start.

However when I open the web. The title shows "Zoneminder Console - Stopped - v1.24.4"
When I tried to start it, a little window came out and said "Applying State Change" and then the Window dissapeared but the Zoneminder console status was still Stopped.
Locked