0

The connection to my ClearDb via WorkBench on my local computer or via PHP (on local comp too) works fine.

But it doesn't works after deployment my PHP program on Heroku - if I run Deploy/View it just hangs.

More specific. My PHP code below:

 $db_host = 'eu-cdbr-west-02.cleardb.net';
    $db_username = 'b0f439327ec632';
    $db_password = '******';
    $db_name = 'heroku_846065d530579e0';
    $db_charset = 'utf8';
    echo "<p>Before  Connection";
    $is_connected = @mysql_connect($db_host, $db_username, $db_password);
    echo "<p> After MySQL Connection. is_connected=$is_connected";

If I run it on my local comp it succeed. If I run it on Heroku, I have echo "Before Connection" and nothing more - no error code, no timeout warning - just nothing. Can anybody help me with this problem?

  • Update. The problem is solved. Heroku didn't like "deprecated" mysql_connect. Everything is fine with mysqli. – Andrey Noskov Nov 29 '18 at 20:27
0

As noted above, this issue is due to the use of the deprecated mysql_connect:

This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used.

Use a non-deprecated API to resolve this.

References

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.