I have a problem, which is that changing the path to execute shell_exec
does not work.
1.- This one works:
<?php
$ruta = 'C:\ASOFTPV\MariaDB-10\bin\mysql.exe';
$usuario = 'root';
$contrasena = '1234';
$carpeta='dbname';
$cmd = ''.$nsis_ruta.' -u '.$nsis_usuario.' -p'.$nsis_contrasena.' -e "create database ' . $carpeta . '"';
$salida = shell_exec($cmd);
?>
2.- This does not work:
<?php
$ruta = 'C:\Program Files\MariaDB 10.1\bin\mysql.exe';
$usuario = 'root';
$contrasena = '1234';
$carpeta='dbname';
$cmd = ''.$nsis_ruta.' -u '.$nsis_usuario.' -p'.$nsis_contrasena.' -e "create database ' . $carpeta . '"';
$salida = shell_exec($cmd);
?>
The objective of this is that the code allows to execute a shell with different routes to access mysql.exe. The one that does not work is on another computer, the path and credentials are fine but it does not emit any errors and does not create the database.