• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 308
  • Last Modified:

Problems getting PHP to connect to MySQL on same server


I have someone trying to get a dashboard working for a company I work for.  He had it working fine on his server.  But having some trouble getting it to work on our server.

He put some echos in there, and it seems to die at mysql_connect because it never gets to the echo right after.

The username and password are correct.  Any idea's what could be going wrong?


        // Initialize Variables for connecting to mySQL
        $mysql_host = "localhost";
        $mysql_uid = "dashboard";
        $mysql_pwd = "password";
        $mysql_db = "dashboard";

        //Open a connection using the parameters
        $mysql_connect = mysql_connect($mysql_host,$mysql_uid,$mysql_pwd) or die(mysql_error());

echo("next");

Open in new window


0
Xetroximyn
Asked:
Xetroximyn
  • 3
  • 3
2 Solutions
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
what error do you get?
0
 
XetroximynAuthor Commented:
No error message as far as I know.  It just seems to die.  The guy trying to set it up just noticed on the php info page it seems to have a "--without-mysql" option.   Any idea how I would take that off?



'./configure' '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--with-mime-magic=/usr/share/file/magic.mime' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-system-tzdata' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba' '--without-unixODBC' '--disable-pdo' '--disable-xmlreader' '--disable-xmlwriter' 

Open in new window

0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
please check with a page just having :
<?php phpinfo(); ?>

Open in new window

if the mysql support is enabled on your server.
other step would be to enable/chage the error_display...
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
XetroximynAuthor Commented:
dur...    I just had to run..

yum install php-mysql

sorry to waste your time!  Thanks for the input!! :)
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
no time wasted if problem is solved :)
CHeers
0
 
XetroximynAuthor Commented:
Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now