qeldroma Posted July 5, 2003 Report Share Posted July 5, 2003 Fatal error: Call to undefined function: mysql_connect() in /var/www/html/templates/sql.php on line 4 ...was the answer as i tried this command. I installed LM9.1 + Apache2 + PHP4 + PHP-MySQL-Module PHP is interpreted, only the mysql-commands not. Does anybody...? Quote Link to comment Share on other sites More sharing options...
scoopy Posted July 6, 2003 Report Share Posted July 6, 2003 Seeing how I just spent the last week reading up on MySQL issues :wink: let me make an attempt at this: I would first doublecheck your $dbname, $dbpass or $dbuname are correct in your config file and check that you can first connect to your MySQL database. Webmin or phpmyadmin are two programs I have been using to check my databases. Quote Link to comment Share on other sites More sharing options...
qeldroma Posted July 6, 2003 Author Report Share Posted July 6, 2003 MySqlCC can access it via the same parameters? Next step? :D Quote Link to comment Share on other sites More sharing options...
scoopy Posted July 6, 2003 Report Share Posted July 6, 2003 Yes, MySqlCC works too. This is the program that helped me fix my MySQL problem. For me, it found a problem in several of the tables and by clicking the quick fix button on each, I was able to salvage my database. What is this line 4 of sql.php ? Do other php scripts run ? And also lets double check which modules you have installed for php and apache. Quote Link to comment Share on other sites More sharing options...
3lade Posted July 7, 2003 Report Share Posted July 7, 2003 I would start at the begining, can you connect to your database from a console? If you can then it is an Apache problem, or failing that it would be a database error. Once you know whats wrong you can try and fix it better. Quote Link to comment Share on other sites More sharing options...
qeldroma Posted July 7, 2003 Author Report Share Posted July 7, 2003 Well, shell-connect is no problem, the connect via other tools either. In that line is only the connect-command, with hardcoded Database variables, as it was as it worked before... I think, that php does not recognize the mysql-module, but how to proove? The module ist htere, inbound in the /etc/php-directory, so no obvious hint for the failure... Quote Link to comment Share on other sites More sharing options...
scoopy Posted July 8, 2003 Report Share Posted July 8, 2003 Gotta double check our syntax here: mysql_connect("localhost","user","pass"); (semi-colons look very much like colons sometimes) and for a laugh, I was searching around for an answer here and came across this: http://www.phphelp.com/ then click on their forums link in top left box. (Its a php help board that needs help with their php.) Quote Link to comment Share on other sites More sharing options...
qeldroma Posted July 8, 2003 Author Report Share Posted July 8, 2003 The syntax is correct! Remember, i told that it worked before LM9.1.... It seems that the php-mysql-module isn't inbound, but how to do? I read in "php.ini" that it just has to be situated in the /etc/php directory, like the rpm did it. But that's not working. In "phpinfo()" i can see some undefined things concerning mysql, so i believe, that this step isn't in order... Quote Link to comment Share on other sites More sharing options...
Guest tezca Posted July 8, 2003 Report Share Posted July 8, 2003 your correct in the phpinfo function, if it dosn't look like its enabled, its not looks to me like you need a couple more rpms from the cd, the ones concerning php & mysql, not the packages themselves, but their "rpm modules" I dont remember the exact names, but trust me that is what the problem is, if you have a gui on that machine bring up the package manager and search for all items that have php and mysql once you see it you'll know what it is. Fatal error: Call to undefined function: mysql_connect() thats why it dosn't recognize this function. Quote Link to comment Share on other sites More sharing options...
Guest xaff Posted July 8, 2003 Report Share Posted July 8, 2003 You need to compile PHP with mysql to be able to use mysql. (./configure --with-mysql) "Call to undefined function" = It's not installed. Syntax for mysql_connect(); mysql_connect("ip", "user", "password"); Though I would recommend putting an @ on it. (Conceals errors) @mysql_connect("ip", "user", "password"); Quote Link to comment Share on other sites More sharing options...
linuxtech Posted July 9, 2003 Report Share Posted July 9, 2003 Hey , update apache 2 from any FTP and I think this solve your problem, but I have problem with mysql_create_db, I dont know what is happening. I you update , try phpinfo and mysql apears to be ok ... Bruno Quote Link to comment Share on other sites More sharing options...
Guest tezca Posted July 13, 2003 Report Share Posted July 13, 2003 you dont need to do all that you just need the "phpmysql.rpm" or something with a name close to that once you install that rpm restart apache and itll detect the new modules and php will work with mysql Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.