[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 282
  • 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
Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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