| Server IP : 162.214.74.102 / Your IP : 216.73.217.111 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/lrsys/public_html/lrsys_apps/imobles/application/install/ |
Upload File : |
<?php
$appurl = $_POST['appurl'];
$db_host = $_POST['dbhost'];
$db_user = $_POST['dbuser'];
$db_password = $_POST['dbpass'];
$db_name = $_POST['dbname'];
if($appurl == '' OR $db_host == '' OR $db_user == '' OR $db_name == ''){
echo 'Please Input all the informations and try again.';
exit;
}
//
//$link = mysqli_connect($db_host, $db_user , $db_password, $db_name);
//
//if (!$link) {
// echo "Error: Unable to connect to MySQL." . PHP_EOL;
// echo "Debugging error: " . mysqli_connect_error() . PHP_EOL;
// exit;
//}
try{
$dbh = new pdo( "mysql:host=$db_host;dbname=$db_name",
"$db_user",
"$db_password",
array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
// database connection successful
//create config file
$input = '<?php
$db_host = \'' . $db_host . '\';
$db_user = \'' . $db_user . '\';
$db_password = \'' . $db_password . '\';
$db_name = \'' . $db_name . '\';
define(\'APP_URL\', \'' . $appurl . '\');
$_app_stage = \'Live\'; // You can set this variable Live to Dev to enable ibilling Debug
//configurações do servidor externo com atualizações dos pluggins
//utilizado somente para atualizar os pluggins por esse acesso
$db_externo_host = \'' . $db_host . '\';
$db_externo_user = \'' . $db_user . '\';
$db_externo_password = \'' . $db_password . '\';
$db_externo_name = \'' . $db_name . '\';
';
$f_msg = 'Can\'t create config file. The folder is not writable. You will have to manually create config file. Create a <strong>config.php</strong> inside- <strong>application</strong> folder with following contents- <hr>
<textarea rows="10" class="form-control">'.$input.'</textarea>
<span class="help-block">iBilling required some folders writable. It seems folders is not writable. The App may not work properly. For common troubleshooting tips, please visit- <strong><a href="http://www.ibilling.io/common-troubleshooting-tips/" target="_blank">http://www.ibilling.io/common-troubleshooting-tips/</a></strong></span>
';
$wConfig = "../config.php";
if(file_exists($wConfig)){
echo 'Config file exist. Please delete- <strong>application/config.php</strong> and try again.';
exit;
}
$fh = fopen($wConfig, 'w') or die($f_msg);
fwrite($fh, $input);
fclose($fh);
echo '1';
}
catch(PDOException $e){
echo 'Connection failed: ' . $e->getMessage();
exit;
}