zep Posted May 8, 2008 Share Posted May 8, 2008 I am moving to a dedicated server (yay!) from a shared hosting package, here are the details: php 5.2.5 mysql 5.0.45 linux fedora litespeed (apache interchangeable) server I compiled php5 with the following: --with-mysql --with-mysqli --with-zlib --with-gd --enable-mbstring --with-mhash --with-mcrypt --with-dom --enable-simplexml --with-pdo-mysql --with-iconv --enable-shmop --enable-track-vars --enable-sockets --enable-sysvsem --enable-sysvshm --enable-magic-quotes (above verified with phpinfo.php, does litepeed show loaded modules like apache? There is no litespeed info section like apache...) added to the php.ini file : extension=apc.so extension=suhosin.so extension=mysql.so extension=mysqli.so extension=pdo_mysql.so extension=pdo.so extension=php_mysql.so extension=libmysql.so ; Default socket name for local MySQL connects. If empty, uses the built-in ; MySQL defaults. mysql.default_socket =/var/lib/mysql/mysql.sock my phpinfo is showing the following for MySql: Active Persistent Links 0 Active Links 0 Client API version 5.0.45 MYSQL_MODULE_TYPE external MYSQL_SOCKET /var/lib/mysql/mysql.sock MYSQL_INCLUDE -I/usr/include/mysql MYSQL_LIBS -L/usr/lib/mysql -lmysqlclient My php scripts work like a charm, but they can't connect to MySQL! I have been drudging through forums looking for something to try, but have not found a solution. I have thus found this forum, which seems to have the most knowledgeable members. Please lend a sugestion, as I am under the gun to get this done, I really apprecite the help! Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted May 8, 2008 Share Posted May 8, 2008 It would not hurt it you posted your script that does not work. Quote Link to comment Share on other sites More sharing options...
zep Posted May 9, 2008 Author Share Posted May 9, 2008 thanks everyone, it was the code that was the issue, or actually the password I had for the database login (I used the old pw) sorry about that I have the PW stored in 3 configuration files, one was wrong, Im sorry for wasting your time... anyway, for those of you troubleshooting a similar issue and winding up in this thread try the following script to do a very simple test to the connection, put it in a plain text file (or use you php ide) and save it as anything really (iI used mysql_test.php) slap it on your server and type the location into your browser. <?php $link = mysql_connect('localhost', 'sbi', 'sbi123'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_close($link); ?> Hope my despair helps somebody! Again thanks for answering this thread. 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.