Mantis & MySQL problems. 
Author Message
 Mantis & MySQL problems.

Morning,
        Have been having some issues with the software.
Mainly that when trying to load up the main page for Mantis, I get the
following error:

Fatal error: Call to undefined function: mysql_connect() in /var/www/html/html/mantis/core_database_API.php on line 39

I have had a look through the said file but nothing is coming up that
raises alarm bells.  I've also had a look through the newsgroups with no
real progress other than the package php-mysql-4.2.2-8.0.5.i386.rpm needs
to be installed which I did earlier to fix another problem.

I have also tried entering the following to verify that all is working
properly: # php -m | grep mysql  This returned mysql which according to
advice I've received indicates that all is working (?)

Software being used is as follows:

PHP 4.2.2
Apache 2.0
MySQL 3.23.52
Mantis 0.17.5
RedHat 8.0

My configuration file (config_inc.php) is below:
================================================
        #######################################################################
        # CONFIGURATION VARIABLES
        #######################################################################

        # In general a value of 0 means the feature is disabled and 1 means the
        # feature is enabled.  Any other cases will have an explanation.

        # Look in configuration.html or default/config_inc1.php for more
        # detailed comments.

        # --- database variables ---------

        # set these values to match your setup
        $g_hostname      = "localhost";
        $g_port          = 3306;         # 3306 is default
        $g_db_username   = "root";
        $g_db_password   = "";
        $g_database_name = "mantis";

        # --- path variables --------------

        # path to your installation as seen from the web browser
        # requires trailing /
        $g_path          = "http://merlin/mantis/";

        # path to your images directory (for icons)
        # requires trailing /
        $g_icon_path     = $g_path."images/";

        # absolute path to your installation.  *NO* symlinks allowed
        # requires trailing /
        $g_absolute_path = "/var/www/html/html/mantis/";

        # --- email variables -------------
        $g_administrator_email  = "removed to protect from spam";
        $g_webmaster_email      = "removed to protect from spam";

        # the "From: " field in emails

        # the "To: " address all emails are sent.  This can be a mailing list or
archive address.
        # Actual users are emailed via the bcc: fields

        # the return address for bounced mail

        # --- login method ----------------
        # CRYPT or PLAIN or MD5 or LDAP or BASIC_AUTH
        $g_login_method = MD5;

        # --- using MS IIS ----------------
        # set to ON if you use IIS
        $g_use_iis = ON;

        # --- email vars ------------------
        # set to OFF to disable email check
        # These should be OFF for Windows installations
        $g_validate_email            = OFF;
        $g_check_mx_record           = OFF;

        # --- register globals -----------

        # if your register_globals is Off then set this to OFF
        $g_register_globals          = ON;
?>
======================================================================
Any help would be appreciated.

Regards,

Andrew.



Wed, 22 Jun 2005 07:01:24 GMT  
 Mantis & MySQL problems.


Quote:
> Fatal error: Call to undefined function: mysql_connect() in
> /var/www/html/html/mantis/core_database_API.php on line 39
> Software being used is as follows:

> PHP 4.2.2
> Apache 2.0
> MySQL 3.23.52
> Mantis 0.17.5
> RedHat 8.0

does a phpinfo() shows informations about MySQL ?
do other mysql related php-products behave correctly ? (phpMyAdmin, ...)

patpro



Wed, 22 Jun 2005 07:20:57 GMT  
 Mantis & MySQL problems.

Quote:



>> Fatal error: Call to undefined function: mysql_connect() in
>> /var/www/html/html/mantis/core_database_API.php on line 39

>> Software being used is as follows:

>> PHP 4.2.2
>> Apache 2.0
>> MySQL 3.23.52
>> Mantis 0.17.5
>> RedHat 8.0

> does a phpinfo() shows informations about MySQL ?
> do other mysql related php-products behave correctly ? (phpMyAdmin, ...)

> patpro

HI,
        Unsure what you mean by "does a phpinfo () show information about MySQL"
(you're dealing with a newbie to PHP & MySQL here *grin*).

As far as phpMyAdmin goes, yes all appears to be working with no problems
there.  In as much as pointing it to the .sql file to create the tables in
the database, there were no problems & phpMyAdmin reports all present &
accounted for.

Regards,

Andrew.



Wed, 22 Jun 2005 07:57:42 GMT  
 Mantis & MySQL problems.


Quote:



> >> Fatal error: Call to undefined function: mysql_connect() in
> >> /var/www/html/html/mantis/core_database_API.php on line 39

> >> Software being used is as follows:

> >> PHP 4.2.2
> >> Apache 2.0
> >> MySQL 3.23.52
> >> Mantis 0.17.5
> >> RedHat 8.0

> > does a phpinfo() shows informations about MySQL ?
> > do other mysql related php-products behave correctly ? (phpMyAdmin, ...)

> > patpro

> HI,
>    Unsure what you mean by "does a phpinfo () show information about MySQL"
> (you're dealing with a newbie to PHP & MySQL here *grin*).

phpinfo() display lost of informations, and if MySQL is properly
integrated in PHP, you should see a full section of phpinfo() output
dedicated to MySQL.
You can create a php web page containing only <?php phpinfo(); ?> and
load it to see the information page.

Quote:
> As far as phpMyAdmin goes, yes all appears to be working with no problems
> there.  In as much as pointing it to the .sql file to create the tables in
> the database, there were no problems & phpMyAdmin reports all present &
> accounted for.

oki, so PHP and MySQL work properly together so your config looks ok.
It's very astonishing, Mantis is a good product and we are using it on 2
servers without any problems (FreeBSD 4.6 Apache 1.3.27 PHP 4.2.3 MySQL
3.23.54 and Linux Apache 1.3.19 PHP 4.2.3 MySQL 3.23.38)

patpro



Wed, 22 Jun 2005 08:04:10 GMT  
 Mantis & MySQL problems.

Quote:






>> >> Fatal error: Call to undefined function: mysql_connect() in
>> >> /var/www/html/html/mantis/core_database_API.php on line 39

>> >> Software being used is as follows:

>> >> PHP 4.2.2
>> >> Apache 2.0
>> >> MySQL 3.23.52
>> >> Mantis 0.17.5
>> >> RedHat 8.0

>> > does a phpinfo() shows informations about MySQL ?
>> > do other mysql related php-products behave correctly ? (phpMyAdmin, ...)

>> > patpro

>> HI,
>>        Unsure what you mean by "does a phpinfo () show information about MySQL"
>> (you're dealing with a newbie to PHP & MySQL here *grin*).

> phpinfo() display lost of informations, and if MySQL is properly
> integrated in PHP, you should see a full section of phpinfo() output
> dedicated to MySQL.
> You can create a php web page containing only <?php phpinfo(); ?> and
> load it to see the information page.

>> As far as phpMyAdmin goes, yes all appears to be working with no problems
>> there.  In as much as pointing it to the .sql file to create the tables in
>> the database, there were no problems & phpMyAdmin reports all present &
>> accounted for.

> oki, so PHP and MySQL work properly together so your config looks ok.
> It's very astonishing, Mantis is a good product and we are using it on 2
> servers without any problems (FreeBSD 4.6 Apache 1.3.27 PHP 4.2.3 MySQL
> 3.23.54 and Linux Apache 1.3.19 PHP 4.2.3 MySQL 3.23.38)

> patpro

Ok,
        That all comes up with no problems.  Let me know if you want the output,
i've saved it as complete HTML which I can mail to your address if you
want it.

Where to now ?

Regards,

Andrew.



Wed, 22 Jun 2005 08:27:42 GMT  
 Mantis & MySQL problems.

Quote:

> Fatal error: Call to undefined function: mysql_connect() in
> /var/www/html/html/mantis/core_database_API.php on line 39

[...]

Quote:
> I have also tried entering the following to verify that all is working
> properly: # php -m | grep mysql  This returned mysql which according to
> advice I've received indicates that all is working (?)

I saw in your other post that mysql is indeed working with some other
php program. This means php-mysql is ok and mysql_connect() is thus
available. I have seen this 'undefined function' error, when in fact
the error was related to unmatched parentheses or some other syntax
error. Try asking on the mantis mailinglist also.

Just to be sure, create a small php script which contains a simple:

<?php

 $link = mysql_connect("localhost", "mysql_user", "mysql_password")
        or die("Could not connect: " . mysql_error());
?>



Wed, 22 Jun 2005 18:51:33 GMT  
 Mantis & MySQL problems.

Quote:
> Ok,
>         That all comes up with no problems.  Let me know if you want the
>         output,
> i've saved it as complete HTML which I can mail to your address if you
> want it.

At this point I don't know how to help you... may be you should try what
Martin is suggesting. As far as I can say, Mantis code is ok and works
out off the box. Did you properly run mantis/sql/db_generate.sql ?

patpro



Wed, 22 Jun 2005 19:40:33 GMT  
 Mantis & MySQL problems.

<snip!>

Quote:

> I saw in your other post that mysql is indeed working with some other
> php program. This means php-mysql is ok and mysql_connect() is thus
> available. I have seen this 'undefined function' error, when in fact
> the error was related to unmatched parentheses or some other syntax
> error. Try asking on the mantis mailinglist also.

> Just to be sure, create a small php script which contains a simple:

> <?php

>  $link = mysql_connect("localhost", "mysql_user", "mysql_password")
>         or die("Could not connect: " . mysql_error());
> ?>

<snip!>

Hi Martin,
                Opening the above .php script in mozilla resulted in the following
error:

Fatal error: Call to undefined function: mysql_connect() in
/var/www/html/html/test2.php on line 3

I created the .php script exactly as you mentioned above but the error
resulted.  Let me know if I screwed up anywhere.

Where it was working, I ran a script which generated the PHP stats.  The
script I ran is listed below:

<?php phpinfo(); ?>

Any ideas where things have gone wrong & is it still worth a post to the
Mantis mailinglist ?

Regards,

Andrew.



Wed, 22 Jun 2005 19:55:33 GMT  
 Mantis & MySQL problems.

Quote:

>> Ok,
>>         That all comes up with no problems.  Let me know if you want the
>>         output,
>> i've saved it as complete HTML which I can mail to your address if you
>> want it.

> At this point I don't know how to help you... may be you should try what
> Martin is suggesting. As far as I can say, Mantis code is ok and works
> out off the box. Did you properly run mantis/sql/db_generate.sql ?

> patpro

As far as I can tell, yes.
I ran the SQL query / script through PHPMyAdmin & all the tables appear to
be created.

I've signed up for the Mantis support list but wanted to see what anyone
here had to offer in terms of advice first.

Thanks for all your help Pat !!

Andrew.



Wed, 22 Jun 2005 20:49:22 GMT  
 Mantis & MySQL problems.


Quote:

> >> Ok,
> >>         That all comes up with no problems.  Let me know if you want the
> >>         output,
> >> i've saved it as complete HTML which I can mail to your address if you
> >> want it.

> > At this point I don't know how to help you... may be you should try what
> > Martin is suggesting. As far as I can say, Mantis code is ok and works
> > out off the box. Did you properly run mantis/sql/db_generate.sql ?

> > patpro

> As far as I can tell, yes.
> I ran the SQL query / script through PHPMyAdmin & all the tables appear to
> be created.

may be there is a .htaccess trick here (very unlikely, but still
possible). Could you put the page Martin suggested you to test, into the
phpmyadmin directory, and test it again from that location ?

It's really strange MyAdmin can interact with MySQL and not a much
simplier app like Mantis.

patpro



Wed, 22 Jun 2005 20:55:24 GMT  
 Mantis & MySQL problems.

Quote:

> may be there is a .htaccess trick here (very unlikely, but still
> possible). Could you put the page Martin suggested you to test, into the
> phpmyadmin directory, and test it again from that location ?

not really a good idea...
I took a look at phpmyadmin files and found this :

libraries/common.lib.php:    $connect_func =
($cfg['PersistentConnections']) ? 'mysql_pconnect' : 'mysql_connect';

you may want to try "mysql_pconnect" in replacement of "mysql_connect"
in the little script from Martin.
If it works, you still have a problem because mysql_connect() should
work too, but it's a good indication.

patpro



Wed, 22 Jun 2005 21:02:26 GMT  
 Mantis & MySQL problems.

Quote:


><snip!>

>> I saw in your other post that mysql is indeed working with some other
>> php program. This means php-mysql is ok and mysql_connect() is thus
>> available. I have seen this 'undefined function' error, when in fact
>> the error was related to unmatched parentheses or some other syntax
>> error. Try asking on the mantis mailinglist also.

>> Just to be sure, create a small php script which contains a simple:

>> <?php
>>  $link = mysql_connect("localhost", "mysql_user", "mysql_password")
>>         or die("Could not connect: " . mysql_error());
>> ?>

> Opening the above .php script in mozilla resulted in the following
> error: Fatal error: Call to undefined function: mysql_connect() in
> /var/www/html/html/test2.php on line 3

Clearly, the mysql functions are not available in your php.

Quote:
><?php phpinfo(); ?>

> Any ideas where things have gone wrong &

Maybe mysql support is not compiled in the php-binary, and must be
loaded on demand. Make sure there is a line in your php.ini like this

extension=mysql.so  

(or 'extension=mysql.dll' in Windows)

Quote:
> is it still worth a post to the Mantis mailinglist ?

No, this is not a Mantis problem.


Wed, 22 Jun 2005 22:40:44 GMT  
 Mantis & MySQL problems.

Quote:



>><snip!>

>>> I saw in your other post that mysql is indeed working with some other
>>> php program. This means php-mysql is ok and mysql_connect() is thus
>>> available. I have seen this 'undefined function' error, when in fact
>>> the error was related to unmatched parentheses or some other syntax
>>> error. Try asking on the mantis mailinglist also.

>>> Just to be sure, create a small php script which contains a simple:

>>> <?php
>>>  $link = mysql_connect("localhost", "mysql_user", "mysql_password")
>>>         or die("Could not connect: " . mysql_error());
>>> ?>

>> Opening the above .php script in mozilla resulted in the following
>> error: Fatal error: Call to undefined function: mysql_connect() in
>> /var/www/html/html/test2.php on line 3

> Clearly, the mysql functions are not available in your php.

>><?php phpinfo(); ?>

>> Any ideas where things have gone wrong &

> Maybe mysql support is not compiled in the php-binary, and must be
> loaded on demand. Make sure there is a line in your php.ini like this

> extension=mysql.so  

> (or 'extension=mysql.dll' in Windows)

>> is it still worth a post to the Mantis mailinglist ?

> No, this is not a Mantis problem.

Hi Martin,
                Sorry, it appears to be enabled in the php.ini file :-(

Here's the contents of where it is:

;Linux world
;
;extension=imap.so
;extension=ldap.so
extension=mysql.so
;extension=odbc.so
;extension=pgsql.so
;extension=snmp.so
;extension=dbg.so

Where to from here ?

Regards,

Andrew.



Thu, 23 Jun 2005 06:15:48 GMT  
 Mantis & MySQL problems.

Quote:


>> Maybe mysql support is not compiled in the php-binary, and must be
>> loaded on demand. Make sure there is a line in your php.ini like
>> this

>> extension=mysql.so  

> Sorry, it appears to be enabled in the php.ini file :-(

The last thing I can think of is to manually load the mysql module
dl(), as in

<?php

if (!extension_loaded('mysql')) {
   echo 'mysql NOT loaded\n';
   if (!dl('mysql.so')) {
        die ('Could not load mysql.so!!!\n');
    }

Quote:
} else {

 echo 'mysql is already loaded\n';

Quote:
}

// Great, we are alive!
// mysq_connect (.....);

?>

Btw, if you try to load mysql.so and it is already loaded, you will
get loads of errors like this:

 Function registration failed - duplicate name - mysql_connect
 Function registration failed - duplicate name - mysql_pconnect
 ...

Read more here:
http://www.php.net/manual/en/function.extension-loaded.php
http://www.php.net/manual/en/function.dl.php



Thu, 23 Jun 2005 23:08:53 GMT  
 Mantis & MySQL problems.

Quote:



>>> Maybe mysql support is not compiled in the php-binary, and must be
>>> loaded on demand. Make sure there is a line in your php.ini like
>>> this

>>> extension=mysql.so  

>> Sorry, it appears to be enabled in the php.ini file :-(

> The last thing I can think of is to manually load the mysql module
> dl(), as in

> <?php

> if (!extension_loaded('mysql')) {
>    echo 'mysql NOT loaded\n';
>    if (!dl('mysql.so')) {
>         die ('Could not load mysql.so!!!\n');
>     }
> } else {
>  echo 'mysql is already loaded\n';
> }

> // Great, we are alive!
> // mysq_connect (.....);

> ?>

> Btw, if you try to load mysql.so and it is already loaded, you will
> get loads of errors like this:

>  Function registration failed - duplicate name - mysql_connect
>  Function registration failed - duplicate name - mysql_pconnect
>  ...

Hi Martin,
                The result returned is:

mysql is already loaded\n

With no other messages displayed on the screen.  When I try to load the
default Mantis page, I am now presented with the login screen which would
suggest that everything is working properly - woohooo !!! :-)

Now just to see if the problem requires that I load the module manually
each time :-)



Fri, 24 Jun 2005 05:18:39 GMT  
 
 [ 17 post ]  Go to page: [1] [2]

 Relevant Pages 

1. Mantis, Ideal, ADS/O or Natural

2. Mantis COBOL + SUPRA

3. MySQL & DCT2MySQL

4. Interbase & MySQL

5. Browse very slow with MySQL & c55EE

6. RexxSql, Win98 & MySql

7. Mysql & Ruby (mswin32)

8. eRuby & MySQL

9. Need a host with PHP & MySQL support

10. PHP4 & MySQL webdevelopment chp:29 Forms

11. Count & Display Rows in MYSQL

 

 
Powered by phpBB® Forum Software