LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-15-2012, 02:15 PM   #1
j.smith1981
Member
 
Registered: Feb 2009
Distribution: Mainly CentOS6.4 x64
Posts: 161

Rep: Reputation: 1
php-clamav-0.15.6 not running make command successfully


Hi there I have a problem, trying to make php-clamav work.

But I keep getting the following error when I run the command:
Quote:
make
This is the output after I run the make command:
Quote:
/bin/sh /root/Downloads/PHP/php-5.4.0/ext/php-clamav-0.15.6/libtool --mode=compile cc -I. -I/home/myuser/mydir/PHP/php-5.4.0/ext/php-clamav-0.15.6 -DPHP_ATOM_INC -I/home/myuser/mydir/PHP/php-5.4.0/ext/php-clamav-0.15.6/include -I/home/myuser/mydir/PHP/php-5.4.0/ext/php-clamav-0.15.6/main -I/home/myuser/mydir/PHP/php-5.4.0/ext/php-clamav-0.15.6 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/myuser/mydir/PHP/php-5.4.0/ext/php-clamav-0.15.6/clamav.c -o clamav.lo
libtool: compile: cc -I. -I/home/myuser/mydir/PHP/php-5.4.0/ext/php-clamav-0.15.6 -DPHP_ATOM_INC -I/home/myuser/mydir/PHP/php-5.4.0/ext/php-clamav-0.15.6/include -I/home/myuser/mydir/PHP/php-5.4.0/ext/php-clamav-0.15.6/main -I/home/myuser/mydir/PHP/php-5.4.0/ext/php-clamav-0.15.6 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/myuser/mydir/PHP/php-5.4.0/ext/php-clamav-0.15.6/clamav.c -fPIC -DPIC -o .libs/clamav.o
/home/myuser/mydir/PHP/php-5.4.0/ext/php-clamav-0.15.6/clamav.c:55: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âclamav_functionsâ
/home/myuser/mydir/PHP/php-5.4.0/ext/php-clamav-0.15.6/clamav.c:71: error: âclamav_functionsâ undeclared here (not in a function)
make: *** [clamav.lo] Error 1
I just can not work out what's wrong I have installed the relevant php-devel (since this would not run phpize if it hadn't).

I have the following versions of clamav:
Quote:
[myuser@mynode php-clamav-0.15.6]# rpm -q clamav
clamav-0.97.4-1.el6.rf.x86_64
[root@server php-clamav-0.15.6]# rpm -q clamav-devel
clamav-devel-0.97.4-1.el6.rf.x86_64
[myuser@mynode php-clamav-0.15.6]#
Again I just am completely stuck any advice is much appreciated, it's probably something I have overlooked but just can't remember what I previously did before my OS upgrade.

Thank you ever so much in advance of any replies,
Jeremy
 
Old 04-15-2012, 02:35 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,260

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Quote:
/home/myuser/mydir/PHP/php-5.4.0/ext/php-clamav-0.15.6/clamav.c:55: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âclamav_functionsâ
/wild guess
Is this is a locale thing? Try

LC_ALL=C make

and when/if it barfs, try
LC_ALL=C make
again

Instead of C, you could also try POSIX

At least it will throw some light on it.
 
Old 04-15-2012, 02:43 PM   #3
j.smith1981
Member
 
Registered: Feb 2009
Distribution: Mainly CentOS6.4 x64
Posts: 161

Original Poster
Rep: Reputation: 1
Still throwing the same error again.

With no other output just exactly the same error

The line 55 of clamav.c contains this:
Quote:
function_entry clamav_functions[] = {
PHP_FE(cl_info, NULL)
PHP_FE(cl_scanfile, second_args_force_ref)
PHP_FE(cl_engine, NULL)
PHP_FE(cl_pretcode, NULL)
PHP_FE(cl_version, NULL)
PHP_FE(cl_debug, NULL)
{NULL, NULL, NULL} /* Must be the last line in clamav_functions[] */
};
Still not sure as I would have thought it could have been the php-devel perhaps? But I have that installed does not make much sense really.

Last edited by j.smith1981; 04-15-2012 at 03:09 PM.
 
Old 04-15-2012, 05:15 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
/bin/sh /root/Downloads/PHP/php-5.4.0/ext/php-clamav-0.15.6/libtool --mode=compile cc -I. -I/home/myuser/mydir/PHP/php-5.4.0/ext/php-clamav-0.15.6 -DPHP_ATOM_INC -I/home/myuser/mydir/PHP/php-5.4.0/ext/php-clamav-0.15.6/include -I/home/myuser/mydir/PHP/php-5.4.0/ext/php-clamav-0.15.6/main -I/home/myuser/mydir/PHP/php-5.4.0/ext/php-clamav-0.15.6 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/myuser/mydir/PHP/php-5.4.0/ext/php-clamav-0.15.6/clamav.c -o clamav.lo
From the snippet above it looks like you're trying to compile from inside the php-5.4.0. What is the php version that is running on your box? And how did you install it?
If it's the latest 5.4.0 compiled from source, I guess this is the reason that you cannot compile the php-clamav extension, as perhaps php-5.4.0 uses some functions incompatible with php-clamav.

Also I see above, that libtool uses the php headers from /usr/include/php, so in fact you're compiling against the php (using php-devel) that came with your distro (you should name your distro too). That could be another reason that compile fails.

You best bet is to remove php-5.4.0, install/update the php/php-devel packages and then try again to compile the extension.

Regards
 
Old 04-16-2012, 02:54 AM   #5
j.smith1981
Member
 
Registered: Feb 2009
Distribution: Mainly CentOS6.4 x64
Posts: 161

Original Poster
Rep: Reputation: 1
I thought I would clean this post up actually (was getting a bit muddled so I will apologise if someone was already reading this post of mine in response to what bathory said (with thanks too) and to business_kid).

The PHP version for the repo from webtatic is PHP 5.4.0 actually outputs as:

Quote:
php54w-5.4.0-1.w6.x86_64.rpm
Though the version of PHP that comes with CentOS is 5.3.3, I tried installing a PHP module using the same php-dev package of course and that even worked (so can't be that).

One would have thought that it would be an annoying incompatibility between php 5.4.0 though if there's anything I have forgotten?

I would like to correct you on this though:
Quote:
Also I see above, that libtool uses the php headers from /usr/include/php, so in fact you're compiling against the php (using php-devel) that came with your distro (you should name your distro too). That could be another reason that compile fails.
It's not the repo of CentOS it's the webtatic repo their all from and this still won't work. Must use the same directory to store them in ( with /usr/include/php).

I have attempted this but I get exactly the same output when I try this:
Quote:
You best bet is to remove php-5.4.0, install/update the php/php-devel packages and then try again to compile the extension.
Though I even compiled another extension PHP left out for some reason and got that working using php-devel.

I did get this part right did not I? (see below):
Quote:
[myuser@mynode ~]# rpm -q clamav
clamav-0.97.4-1.el6.rf.x86_64
[root@mynode ~]# rpm -q clamav-devel
clamav-devel-0.97.4-1.el6.rf.x86_64
[myuser@mynode ~]#

Last edited by j.smith1981; 04-16-2012 at 06:50 AM.
 
Old 04-16-2012, 08:00 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

Out of curiosity, I've tried to build php-clamav in a test box running php-5.4.0 and it failed. Doing the same in another box running php-5.3.10 was successful, so the problem is the php version.
Maybe you should downgrade to Centos official php-5.3.3 (or get a newer 5.3.x from a third party repo)

Regards
 
1 members found this post helpful.
Old 04-17-2012, 04:22 AM   #7
j.smith1981
Member
 
Registered: Feb 2009
Distribution: Mainly CentOS6.4 x64
Posts: 161

Original Poster
Rep: Reputation: 1
Oh well that's good to know.

I thought it was just me makes perfect sense I was sure I was following what I'd done previously Imagick won't work either with PHP I might just go back to the previous 5.3 version like you just said.

Thanks ever so much bathory (I though I was going mad lol).

Kind regards.

PS I will try and get back php 5.3 since I think its just running yum with webtatic on packages from php53 (or at least from what I can remember).

Last edited by j.smith1981; 04-18-2012 at 02:52 AM.
 
Old 05-14-2012, 11:15 AM   #8
runner
LQ Newbie
 
Registered: Sep 2004
Posts: 2

Rep: Reputation: 1
To get PHP 5.4.1 to work with ClamAV-0.97.4 and the php-clamav-0.15.6 extension:

Change line 55 in clamav.c of the php-clamav extension software

from
function_entry clamav_functions[] = {

to
zend_function_entry clamav_functions[] = {

Last edited by runner; 05-15-2012 at 06:54 AM.
 
1 members found this post helpful.
Old 05-15-2012, 04:59 AM   #9
j.smith1981
Member
 
Registered: Feb 2009
Distribution: Mainly CentOS6.4 x64
Posts: 161

Original Poster
Rep: Reputation: 1
That worked thank you ever so much!

I will log that down

Thanks again,
Jez
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Worried about the linux command not running in php shreyansh Linux - Newbie 18 05-21-2010 12:49 AM
Running the mount command from PHP Dhamon Programming 5 04-10-2009 03:32 AM
running a php script from command line leicaphotos Linux - Newbie 1 10-10-2008 01:24 PM
running iptable command as php programming omid1979 Programming 1 07-15-2006 08:36 AM
Problems running make install for php jimieee Linux - Software 5 12-30-2003 03:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration