PHP55 and MySQL56 -- cannot connect

aljoschapeters apeters at gmx.net
Fri Aug 1 02:01:57 PDT 2014


Hi and hello,

MacPorts is a great piece of software and first I wanna thank all of you for
that!

I'm working on my BA-Thesis and therefor developping an information
retrievel system using Apache+PHP+MySQL. I use a VM with WinXP and
Apachefriends' Xampp. I installed it on an external HDD.
But I wanna develop also when I'm under way (university, friends, ...) and
it's kind of annoying that I always have to carry the external HDD with me.
So I decided to install Apache, PHP and MySQL with MacPorts (I need >=
PHP55).

Everything works fine. Apache is running, PHP is running, MySQL is running.
BUT: PHP cannot connect to the MySQL-Server. When I use the MySQL-Client, it
works. But using - for testing -

<?php

$mysqli = new mysqli("localhost", "root", "ap+0206", "phpmyadmin");
if ($mysqli->connect_errno) {
    echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " .
$mysqli->connect_error;
}
echo $mysqli->host_info . "\n";

echo phpinfo();
?>

produces errors:
Warning: mysqli::mysqli(): (HY000/2002): No such file or directory in
/opt/local/apache2/htdocs/blub.php on line 3

phpinfo() information for mysqli:
<http://mac-os-forge.2317878.n4.nabble.com/file/n259928/mysqli.png> 

As you can see, I changed php.ini to point to the (hopefully)
mysql.socket-file?!

I don't know how to fix it, because the MacPorts-Wiki and searching the web
do not help :/

thanks a lot for your help!



--
View this message in context: http://mac-os-forge.2317878.n4.nabble.com/PHP55-and-MySQL56-cannot-connect-tp259928.html
Sent from the MacPorts - Users mailing list archive at Nabble.com.


More information about the macports-users mailing list