PMA 4.1.14.1, PHP 5.3.28:
- run setup/index.php,
- create a new server with the following parameters: Connection type: tcp, PHP extension to use: mysqli, Server port: 3306 (or any other value which your MySQL server is listening to, this value cannot be left blank),
- click Apply,
- click Edit link, on the server list, next to a recently appended server,
- ,,Could not connect to MySQL server - mysqli_connect() expects parameter 5 to be long, string given'' message appears.
This bug appears to be born with PMA 3.x (when server validation was added to the setup script) and stills until PMA 4.2.5. It occurs in test_db_connection() at setup/lib/validate.lib.php (3.x), and in test_db_connection() at libraries/config/validate.lib.php (4.0.x), and in PMA_Validator::testDBConnection() at libraries/config/Validator.class.php (4.1.x, 4.2.x).
In these functions $port value is constructed as a string of the form: ":XXXX", where XXXX is the actual port number. Ad hoc solution:
in mentioned above functions/files change:
$conn = @mysqli_connect($host, $user, $pass, null, $port, $socket);
to:
$conn = @mysqli_connect($host, $user, $pass, null, $port ? (int)substr($port, 1) : null, $socket);
Suggested patch:
https://github.com/phpmyadmin/phpmyadmin/pull/1264
Same patch, signed by me with original author referenced:
https://github.com/phpmyadmin/phpmyadmin/commit/03146789859c002dc85326154282859bbfe43848