LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-28-2004, 02:31 PM   #1
sonaatti
LQ Newbie
 
Registered: Sep 2004
Posts: 17

Rep: Reputation: 0
mysql


Slackware 10, kernel 2.6.7

cant connect to mysql via php.

It returns nothing, no error messages nothing.

Trying to run an Imagegallery that worked fine on another server, On my server all php functions work except mysql, the script contains error messages. for example if it canīt connect to mysql server it should say cant connect.... but all I get is a blank page. :/
 
Old 11-28-2004, 03:49 PM   #2
Pecunia
LQ Newbie
 
Registered: May 2003
Location: The Netherlands
Distribution: LFS
Posts: 28

Rep: Reputation: 15
The default of the newer versions of PHP is to generate no errors/warnings whatsoever on the page, but instead log them to the server log file. This is the best set-up for a production server, but not for a testing server.

To (temporarily) turn error-reporting on so you can debug your mysql connection, open your php.ini file and set the following:
error_reporting = E_ALL
display_errors = On
Don't forget to set them back to their old values (if desired) when you're done.

Alternatively, you can check Apache's error log to see what exactly goes wrong with the mysql connection.
 
Old 11-28-2004, 04:22 PM   #3
sonaatti
LQ Newbie
 
Registered: Sep 2004
Posts: 17

Original Poster
Rep: Reputation: 0
[Sun Nov 28 23:16:33 2004] [notice] Apache/1.3.32 (Unix) PHP/4.3.9 configured -- resuming normal operations
[Sun Nov 28 23:16:33 2004] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sun Nov 28 23:19:04 2004] [notice] caught SIGTERM, shutting down

thatīs all it says

hereīs some code

if (@mysql_query($sql)) {
echo 'Added comment<br><hr>';
} else {
echo 'It wasnīt possible to add any comments';
}

and itīs still just a blank page..... so thereīs something really wrong here
 
Old 11-28-2004, 04:29 PM   #4
Pecunia
LQ Newbie
 
Registered: May 2003
Location: The Netherlands
Distribution: LFS
Posts: 28

Rep: Reputation: 15
Quote:
if (@mysql_query($sql)) {
Ok, what you're saying with the '@mysql_query' there, is: "execute the function "mysql_query" and suppress any notices, warnings and errors it might generate". Remove the '@' to see the errors. For more information about error control in PHP, see the PHP manual.
 
Old 11-28-2004, 04:41 PM   #5
sonaatti
LQ Newbie
 
Registered: Sep 2004
Posts: 17

Original Poster
Rep: Reputation: 0
Yes indeed Iīm a newbie and should read the manual, however I removed the @ in different places...

Call to undefined function: mysql_connect()

so it doesnīt seem to support mysql functions at all
itīs compiled with mysql so I really dont understand this

hereīs the phpinfo output
Configure Command './configure' '--prefix=/usr' '--disable-static' '--with-apxs=/usr/sbin/apxs' '--sysconfdir=/etc' '--enable-discard-path' '--with-config-file-path=/etc/apache' '--enable-safe-mode' '--with-openssl' '--with-mhash' '--enable-bcmath' '--with-bz2' '--with-pic' '--enable-calendar' '--enable-ctype' '--with-gdbm' '--with-db3' '--with-imap-ssl=/usr/local/lib/c-client' '--with-imap=/usr/local/lib/c-client' '--enable-dbase' '--enable-ftp' '--with-iconv' '--with-exif' '--enable-exif' '--with-gd' '--enable-gd-native-ttf' '--with-jpeg-dir=/usr' '--with-png' '--with-gmp' '--with-mysql=shared,/usr' '--with-gettext=shared,/usr' '--with-expat-dir=/usr' '--with-xml' '--enable-wddx' '--with-mm=/usr' '--enable-trans-sid' '--enable-shmop' '--enable-sockets' '--with-regex=php' '--enable-sysvsem' '--enable-sysvshm' '--enable-yp' '--enable-memory-limit' '--with-tsrm-pthreads' '--enable-shared' '--disable-debug' '--with-zlib=/usr'

Last edited by sonaatti; 11-28-2004 at 04:52 PM.
 
Old 11-28-2004, 05:05 PM   #6
sonaatti
LQ Newbie
 
Registered: Sep 2004
Posts: 17

Original Poster
Rep: Reputation: 0
I found the solution here ->
http://www.vttoth.com/badmysql.htm

just had to add the extension_dir in php.ini ....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 03:13 PM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 08:19 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 02:52 AM
Problems with MySQL on SuSE: Can't Connect (/var/lib/mysql/mysql.sock) neocookie Linux - Software 8 02-08-2008 12:48 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 09:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:02 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