Menu

Compilation Errors under RedHat 9

Help
castic
2005-06-07
2013-04-23
  • castic

    castic - 2005-06-07

    Hi guys,

    I've been trying for days to get mod_auth_mysql-2.9.0 to compile with no luck.

    My Linux box has the following installed:

    Linux Redhat 9
    gcc 3.4.4
    Apache 1.3.9 + apache_ssl-1.3.7
    Mysql 4.1.12
    PHP 4.2.2

    I have mysql and apache installed in /opt/apps/

    When I try to compile mod_auth_mysql with

    /opt/apps/apache/bin/apxs -c -L/usr/lib/mysql/ -I/opt/apps/mysql/include/mysql/mysql/ -lmysqlclient -lm -lz mod_auth_mysql.c

    I get the following as output:

    gcc -DLINUX=2 -DTARGET="httpsd" -DUSE_HSREGEX -DUSE_EXPAT -I../lib/expat-lite -DAPACHE_SSL -fpic -DSHARED_MODULE -I/opt/apps/apache/include -I/opt/apps/mysql/include/mysql/mysql/  -c mod_auth_mysql.c
    mod_auth_mysql.c:76:29: missing binary operator before token "("
    mod_auth_mysql.c:253:19: mysql.h: No such file or directory
    mod_auth_mysql.c:355: error: parse error before '*' token
    mod_auth_mysql.c:355: warning: data definition has no type or storage class
    mod_auth_mysql.c: In function `open_db_handle':
    mod_auth_mysql.c:408: error: syntax error before "mysql_conn"
    mod_auth_mysql.c:415: error: `mysql_conn' undeclared (first use in this function)
    mod_auth_mysql.c:415: error: (Each undeclared identifier is reported only once
    mod_auth_mysql.c:415: error: for each function it appears in.)
    mod_auth_mysql.c:415: warning: assignment makes pointer from integer without a cast
    mod_auth_mysql.c:433: warning: assignment makes pointer from integer without a cast
    mod_auth_mysql.c: In function `create_mysql_auth_dir_config':
    mod_auth_mysql.c:473: error: `MYSQL_UNIX_ADDR' undeclared (first use in this function)
    mod_auth_mysql.c: In function `format_remote_host':
    mod_auth_mysql.c:777: warning: return makes pointer from integer without a cast
    mod_auth_mysql.c: In function `format_filename':
    mod_auth_mysql.c:786: warning: return makes pointer from integer without a cast
    mod_auth_mysql.c: In function `format_server_name':
    mod_auth_mysql.c:790: warning: return makes pointer from integer without a cast
    mod_auth_mysql.c: In function `format_server_hostname':
    mod_auth_mysql.c:794: warning: return makes pointer from integer without a cast
    mod_auth_mysql.c: In function `format_protocol':
    mod_auth_mysql.c:798: warning: return makes pointer from integer without a cast
    mod_auth_mysql.c: In function `format_method':
    mod_auth_mysql.c:802: warning: return makes pointer from integer without a cast
    mod_auth_mysql.c: In function `format_args':
    mod_auth_mysql.c:807: warning: return makes pointer from integer without a cast
    mod_auth_mysql.c: In function `format_request':
    mod_auth_mysql.c:821: warning: return makes pointer from integer without a cast
    mod_auth_mysql.c: In function `format_uri':
    mod_auth_mysql.c:825: warning: return makes pointer from integer without a cast
    mod_auth_mysql.c: In function `get_mysql_pw':
    mod_auth_mysql.c:835: error: `MYSQL_RES' undeclared (first use in this function)
    mod_auth_mysql.c:835: error: `result' undeclared (first use in this function)
    mod_auth_mysql.c:892: error: `MYSQL_ROW' undeclared (first use in this function)
    mod_auth_mysql.c:892: error: parse error before "data"
    mod_auth_mysql.c:893: error: `data' undeclared (first use in this function)
    mod_auth_mysql.c: In function `get_mysql_groups':
    mod_auth_mysql.c:923: error: `MYSQL_RES' undeclared (first use in this function)
    mod_auth_mysql.c:923: error: `result' undeclared (first use in this function)
    mod_auth_mysql.c:961: error: `MYSQL_ROW' undeclared (first use in this function)
    mod_auth_mysql.c:961: error: parse error before "data"
    mod_auth_mysql.c:962: error: `data' undeclared (first use in this function)
    apxs:Break: Command failed with rc=65536

    No mod_auth_mysql.so file is generated.

    I also noticed the line above that says: "mod_auth_mysql.c:253:19: mysql.h: No such file or directory" but I made certain that the path to the mysql headers are correct.

    Please help!

    As I said above, I have been trying for days to compile. I've spent hours on Google with no luck. I left work at 3am yesterday trying with older versions of mod_auth_mysql but still no luck.

    Thanks in advance for all your help,

    Alan Harrylal

    System Admin
    Florida International University
    College of Arts & Science Technology & Information Services
    (CASTIC)

     
    • castic

      castic - 2005-06-07

      OOPS I made a slight mistake:

      The option "-I/opt/apps/mysql/include/mysql/mysql/" contains an extra 'mysql' in it. It should of been "-I/opt/apps/mysql/include/mysql/"

      When I tried to compile with the correction, I don't get the "mysql.h no such file or directory" message but I still get the following:

      mod_auth_mysql.c:76:29: missing binary operator before token "("
      mod_auth_mysql.c: In function `format_remote_host':
      mod_auth_mysql.c:777: warning: return makes pointer from integer without a cast
      mod_auth_mysql.c: In function `format_filename':
      mod_auth_mysql.c:786: warning: return makes pointer from integer without a cast
      mod_auth_mysql.c: In function `format_server_name':
      mod_auth_mysql.c:790: warning: return makes pointer from integer without a cast
      mod_auth_mysql.c: In function `format_server_hostname':
      mod_auth_mysql.c:794: warning: return makes pointer from integer without a cast
      mod_auth_mysql.c: In function `format_protocol':
      mod_auth_mysql.c:798: warning: return makes pointer from integer without a cast
      mod_auth_mysql.c: In function `format_method':
      mod_auth_mysql.c:802: warning: return makes pointer from integer without a cast
      mod_auth_mysql.c: In function `format_args':
      mod_auth_mysql.c:807: warning: return makes pointer from integer without a cast
      mod_auth_mysql.c: In function `format_request':
      mod_auth_mysql.c:821: warning: return makes pointer from integer without a cast
      mod_auth_mysql.c: In function `format_uri':
      mod_auth_mysql.c:825: warning: return makes pointer from integer without a cast
      apxs:Break: Command failed with rc=65536

      Sorry for the error in my first post.

      Again, thanks for all your time in advance,

      Alan Harrylal

       
    • Jerry Stuckle

      Jerry Stuckle - 2005-06-08

      Hi, Alan,

      Sorry for the delay in responding, but I've been out of the office.

      It looks like your first problem is the macro AP_MODULE_MAGIC_AT_LEAST is not defined.  This should be defined in ap_mmn.h (in your Apache include directory). 

      I couldn't find what version defined this macro, but I suspect at least part of your problem is how old your Apache version is.  You're at 1.3.9; current is 1.3.33.  We've tested with some recent backlevels of Apache 1.3.x, but not that far back. 

      It's also very probable your other errors are also related to your old release.The functions being referenced are defined at least in Apache 1.3.31 - but it looks like not in your version.

      The first thing I would recommend is that you upgrade your Apache to 1.3.33.  There should be few or no changes when doing this.  Additionally, you'll be getting a supported version of Apache (1.3.9 is no longer being supported by the Apache Foundation).  You'll also have a more secure system because there have been numerous security patches (as well as other fixes) since 1.3.9 was released.

      Jerry

       
    • castic

      castic - 2005-06-09

      Hello Jerry,

      I must applaud you for finding the time to respond to most, if not all, of the users who post messages in this help forum (i've been reading a lot of them).

      It is really nice and comforting to know that you guys at SourceForge stand behind your projects and are willing to offer support when someone asks for it; especially since the software is open source.

      As far as my problems with RedHat 9, Apache 1.3.9 and mod_auth_mysql2.9.0 goes, I will indeed try your suggestions as to upgrading my version of Apache to 1.3.33 and then trying to recompile the module.

      I managed to get an older version of the module working for right now, version 2.30a.

      I know that there have been many improvements since this version but I really needed to get this running for a project that is due by the end of this week.

      I will try your suggestions a I said an I will keep you up to date on what happens.

      Thanks again Jerry...Keep up the Good Work!

      Alan Harrylal
      Systems Admin
      Florida International University

       
    • Jerry Stuckle

      Jerry Stuckle - 2005-06-10

      Alan,

      I do understand your problem with deadlines - I've seen enough of them in the past!

      I suspect 2.81 would work for you, also - most of the code you are having problems with were added in the 2.90 version.

      We're currently working on version 3.00, which has some minor performance improvements - but the major change is some restructuring of the code.  It won't fix your problem right now - but I'm glad this came up now.  It means we need to look to see if we can handle the older versions somehow.

      Normally we don't try to be completely compatible with every older version - it would be just too hard.  However, if it's a minor change I think we may be able to work with it.

      One thing I would need would be a copy of your version of ap_mmn.h to see just what is defined and what isn't. We depend on the AP_MODULE_MAGIC_AT_LEAST macro to determine some version information.  If that isn't defined, we can make some assumptions and bypass some of the code.

      I don't know if we can do everything - I need to look more closely at the code.  But with the restructuring it should be easier.

      Again - no guarantees, but we'll do whatever we can.

      And BTW - thanks for the compliments.  But I don't work at SourceForge - this is just a repository for the module.  I, like most other administrators/developers, have a full time job. I work on this module because I use it, I like it, and I'm interested in seeing it improved.  I can't always spend as much time on it as I wish - but I spend whatever time I have.  It's both easier and harder for me in one respect - I have my own company, so I don't have a boss to answer to.  However, I do have customers and contractors which get upset if I don't do my job! :-)

      Jerry

       
    • dandcp

      dandcp - 2005-06-23

      I get an error when I try to compile as well here.  trying to compile ver 3.0.0

      I get this error though.

      apxs -c -lmysqlclient -lm -lz mod_auth_mysql.c
      gcc -DLINUX=22 -DEAPI -DEAPI_MM -O2 -march=i386 -mcpu=i686 -fPIC -DEAPI_MM_CORE_PATH=/var/run/httpd.mm -fpic -DSHARED_MODULE -I/usr/include/apache  -c mod_auth_mysql.c
      apxs:Break: Command failed with rc=16777215

      FYI: my host has Apache version 1.3.27

      Any ideas?  Thanks

       
    • Jerry Stuckle

      Jerry Stuckle - 2005-06-23

      Dandcp,

      Hmmm, without more information on what's happening, it's hard to say.  Just a "Command Failed" doesn't tell us much.

      Can you try running the gcc command listed by itself?  I've found sometimes that gives additional information that apxs seems to hide.

      Jerry

       
    • dandcp

      dandcp - 2005-06-23

      Jerry,  Thanks for the response.

      Sorry (I am just learning) I really don't know exactly what all these commands mean or do.  I am just going by what someone has informed me on how to compile mod_auth_mysql.

      I don't know how to run the gcc command by itself.  Can you please explain to me and I would be happy to try whatever.

      Maybe I can explain what I am doing (and hopefully I am posting in the correct area to get help with what I am doing)

      This is what I am initially trying to do:  "I am trying to create a simple local intranet (sort of) but it will just be a subdomain off my main site which is hosted on westhost.com. We have about 50 or so staff that will need access. The thing is that all of they already have a username and password from our national intranet (and I don't have that info). I was hoping to have them be able to "register" on their first visit and enter their username and password (so they don't have to remember another one), then this info will go into a DB that I have created. I actually have this part working I think.

      Then on any future visits to the "local intranet" or any page in the "local intranet" (which isn't that large but whole directory needs to be protected, not just one page). they would be prompted to enter their username and password. Which would then check against what is listed in the DB."

      OK,  So what I was told to do what to download mod_auth_mysql and upload it to the server.  unarchive it,  which I have all done so far.  The next step was to compile it.  and was told to do this:

      apxs -c -lmysqlclient -lm -lz mod_auth_mysql.c

      when I enter that I get these results:

      gcc -DLINUX=22 -DEAPI -DEAPI_MM -O2 -march=i386 -mcpu=i686 -fPIC -DEAPI_MM_CORE_PATH=/var/run/httpd.mm -fpic -DSHARED_MODULE -I/usr/include/apache  -c mod_auth_mysql.c
      apxs:Break: Command failed with rc=16777215

      I have googled this error and haven't found any good news yet. 

      So I come to the source to see if anyone has run into this before.  or is this a bug or is there a way to work around?

      I would appreciate any advice.

      Thanks,
      Doug

       
    • Jerry Stuckle

      Jerry Stuckle - 2005-06-23

      Doug,

      Not a problem, although I think you should get some guidance from someone familiar with Linux to help you set up your machine.  What you're doing isn't "plug and play", and I suspect you'll run into other problems, also.  And if you're not careful, you can run into problems like becoming an open relay for spammers - causing you no end of problems!

      As for your current problem - apxs is just a command file which calls other programs to do some work.  One of these is the compiler.  You can see the compile command - it's the one that goes:

      gcc -DLINUX=22 -DEAPI -DEAPI_MM -O2 -march=i386 -mcpu=i686 -fPIC -DEAPI_MM_CORE_PATH=/var/run/httpd.mm -fpic -DSHARED_MODULE -I/usr/include/apache -c mod_auth_mysql.c

      Enter this whole string yourself at a command line prompt to get it to execute (case IS important!).

      Hopefully this will give us more output than "Command failed...".  That isn't enough to tell us what's wrong.

      Jerry

       
      • dandcp

        dandcp - 2005-06-23

        I don't know anyone familiar with Linux.  And it isn't my machine it is on my webhost.  which is run by westhost.com.

        regarding the command file.  what I entered exactly at the prompt is this:
        "apxs -c -lmysqlclient -lm -lz mod_auth_mysql.c"  without quotes

        after hitting enter this is what is displayed exactly:
        "gcc -DLINUX=22 -DEAPI -DEAPI_MM -O2 -march=i386 -mcpu=i686 -fPIC -DEAPI_MM_CORE_
        PATH=/var/run/httpd.mm -fpic -DSHARED_MODULE -I/usr/include/apache  -c mod_auth_
        mysql.c
        apxs:Break: Command failed with rc=16777215"

        I don't know what it all means but I know there was an error in trying to compile the module.  and I can't go to the next step to copy it to where Apache can use it.

        When I try to do what I think you are telling me ,enter this: "gcc -DLINUX=22 -DEAPI -DEAPI_MM -O2 -march=i386 -mcpu=i686 -fPIC -DEAPI_MM_CORE_PATH=/var/run/httpd.mm -fpic -DSHARED_MODULE -I/usr/include/apache -c mod_auth_mysql.c" 

        I get a command not know.

        What else should I try?

        Thanks
        Doug

         
    • Jerry Stuckle

      Jerry Stuckle - 2005-06-24

      Doug,

      Well, it looks like the gcc compiler isn't installed on your system.  You'll need to download and install it first.

      Unfortunately, I'm not familiar with RedHat, so I can't tell you which rpm you need to download.  You might try the RedHat site or westhost forums.

      Jerry

       
    • yahnice

      yahnice - 2005-06-24

      hy, a bit of help to install gcc on a redhat machine :

      three packages provides the compiler :

      libgcc-3.2-7
      gcc-3.2-7
      gcc-c++-3.2-7

      i hope this can help you

      yahnice

       
    • dandcp

      dandcp - 2005-06-25

      Jerry,

      You are right on.  GCC was NOT installed on my system.  I was directed where and how to do this and I think I am now back on track.

      Thanks so much.

      hopefully I can get this working.

      Doug

       
    • dandcp

      dandcp - 2005-06-28

      Jerry,

      I ran into another problem here.  My last post, I realized that GCC was not installed so I got that installed and was able to compile it and was doing the next step of adding the line (actually it was in there already just had to uncomment it)

      LoadModule mysql_auth_module  modules/mod_auth_mysql.so

      I removed the # and restarted Apache and then that is when I had problems again. My site went down. So had put back the #.

      This is the error I got:

      Code:
      Syntax error on line 228 of /etc/httpd/conf/httpd.conf:

      Cannot load /etc/httpd/modules/mod_auth_mysql.so
      into server: /etc/httpd/modules/mod_auth_mysql.so:
      undefined symbol: mysql_store_result
      So not sure what this means exactly. What do you suggest I try next?
      It seems like I am getting closer. I can almost feel it! 

      -Doug

       
    • Jerry Stuckle

      Jerry Stuckle - 2005-06-28

      Hi, Doug,

      Do you have anything else running on Apache which has MySQL built it?  For instance - PHP comes with an older version of MySQL libraries, and Apache can't use two different copies of the same library.

      Jerry

       
      • dandcp

        dandcp - 2005-06-28

        Yes, probably.  What can I do about it?  Delete the old one?

        I have
        -MySQL 3.23.56
        -phpMyAdmin 2.6.0
        -Mod Php 4.3.0  (is is best to upgrade to Mod Php 5.0.3?

        So what is the solution so to have just one copy to make Apache happy again?

        -Doug

         
    • Jerry Stuckle

      Jerry Stuckle - 2005-06-28

      The only way around this problem is to compile all products using MySQL with the same MySQL libraries.

      If you know what version the other product is using, you should be able to download that version of MySQL and compile mod_auth_mysql against that library.

      Otherwise, what most people do is to recompile the other product(s) against the current version of MySQL.

      This isn't a mod_auth_mysql or Apache problem - it's a limitation of how Unix works.  Only one copy of a library will be loaded when a program (in this case Apache) starts.  (Windows is like this, also.)

      I know it's a pain.  But since this has been a problem with PHP, the PHP team has changed their distribution so they no longer ship the MySQL libraries.

      But if it is PHP loading the library, I wouldn't recommend just upgrading without checking it out first.  There have been some changes in their code.  Recompiling would be better.

      Jerry

       
      • dandcp

        dandcp - 2005-06-28

        Thanks Jerry,

        But how do I go about doing this exactly? 

        1. find out what version the other products are using?
        2. how do I download the SQL library and where?
        3. compile mod_auth_mysql against that library?

        From what I can see I have MySQL 3.23.56 but could upgrade to MySQL4 4.1.9.  what do you suggest?

        Thanks again.  We will get this figured out and working!

        -Doug

         
    • rodnod

      rodnod - 2005-06-28

      Hi Guys,
      Had the same or a very similar problem a while ago. Jerry and I finally worked it out... Remove Apache, PHP, and MySQL and start from scratch.
      Install MySQL first, might as well upgrade to v4 while your at it. All other packages are then complied with the same MySQL libraries. Then compile and install Apache, PHP and finally mod_auth_mysql.
      Once I did this all worked fine.
      As for the C compiler, I used the version supplied with RedHat, seemed to work OK, but make sure you have the RedHat development tools installed.
      Cheers
      Rod.

       
    • Jerry Stuckle

      Jerry Stuckle - 2005-06-29

      Hi, Alan,

      And thanks for chiming in, Rod.

      Rod is correct in the process.  However, there are a large number of options in each of the packages, and you need to understand what you need.

      At this point I think you really need to find a Linux sysadmin.  This is a lot more than we can help you with in the forum.  It will take someone more familiar with your system and your needs.

      Jerry

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.