script works on local host but not on live server

I have below script. It works perfect on local host but does not work on live server (hosting).

Actually the input value is from array but does not work.

echo $user_info[0] = 'http://'.Punycode::encodeHostname(trim($user_info[0]));

While this line input is given manually and it works perfect on live server.

echo $convert = 'http://'.Punycode::encodeHostname(trim('bücher.ch')); 

The code

<?php


include_once("punycode.class.php");
$post_list  = array();

$outputlist="";

if(isset($_POST["submit"])) {

    //$txturl = preg_replace('#^https?://#', '', rtrim($_POST['links'],'/'));
     $input_list =  preg_replace('/n+/', "n", trim($_POST['urllist']));

    $input_list = explode("n", $input_list);
    //shuffle($input_list);



        for($i=0;$i<count($input_list);$i++) {


            $post_list = (trim($input_list[$i]));
            $user_info = explode('|', $post_list);

            $user_info[0] = preg_replace('#^https?://#', '', rtrim($user_info[0],'/'));

            echo $user_info[0] = 'http://'.Punycode::encodeHostname(trim($user_info[0])); // This is not working Punycode::encodeHostname(trim($user_info[0]))
            echo '<br>';
            echo $convert = 'http://'.Punycode::encodeHostname(trim('bücher.ch')); // This line work perfect.
            $user_info[1];
            $user_info[2];


            $outputlist .= 'Scrpated vlaue for input ' . $user_info[0]. '==>' .$user_info[1] . '==>' . $user_info[2] .'
' ;
        }
}   
?>


<form method="POST" action="problem.php">
<textarea name = "urllist" rows ="20" cols="150" placeholder="Past Urls here! domain.com|phonenumber|email@address.com"><?php if(!empty($_POST["urllist"])) { echo $_POST["urllist"]; } ?></textarea>   
<textarea name = "output" rows ="20" cols="150"  > <?php echo $outputlist;  ?></textarea>   
<br/><br/>
<center>
<input type="submit" name="submit" value="Generate">
</center>
</form>

Use this line for input test..

bücher.ch/|username|password

This script is live here globalitsoft.net/scripts/problem.php


Source: stackoverflow-php

Cannot connect to mysql local host all settings seem correct

I have been all over S.O. and almost all questions invariably give the same answers .. I must be missing something glaringly obvious in my setup:

The questions I have viewed and followed are extensive — So I really am banging my head against a wall here ..

my user is ‘devUser’ in this case:

enter image description here

My PHP is:

$server = "localhost"; // -- YES I'VE ALSO TRIED 127.0.0.1, AND LOCAL 10.2.6.50
$database = "some_database";
$username = "devUser";
$password = "some_pass"; // This pass works for MySQL workbench -- It's good

$mysqlConnection = new mysqli($server, $username, $password);

if (!$mysqlConnection) {
    die("There was a problem processing your request!");
    // For debugging -- die("Connection failed: " . $conn->connect_error);
} else {
    mysqli_select_db($mysqlConnection, $database);
}

It’s worth mentioning that Workbench connects successfully with that user using ssh tunnel -> 127.0.0.1 –> 3306 –> devUser –> some_pass

Also my my.cnf is set to bind-address 0.0.0.0:

[mysqld_safe]
socket          = /var/run/mysqld/mysqld.sock
nice            = 0

[mysqld]

user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking

bind-address            = 0.0.0.0

key_buffer_size         = 16M
max_allowed_packet      = 16M
thread_stack            = 192K
thread_cache_size       = 8
myisam-recover-options  = BACKUP
query_cache_limit       = 1M
query_cache_size        = 16M
log_error = /var/log/mysql/error.log
expire_logs_days        = 10
max_binlog_size   = 100M

This isn’t rocket science, but my brain is tired and I think I am having tunnel vision — Can someone see the glaring error?


Source: stackoverflow-php