I have a problem, and I have not found the solution. What happens is that I charge my project in xamp, htdocs, in windows and I open the page and all without any inconvenience. But when doing the same in linux I see this error on the web.
Warning: require_once (/inicio.php): failed to open stream: The file or directory does not exist in /opt/lampp/htdocs/festivalvallenato/index.php on line 12
Fatal error: require_once (): Failed opening required '/inicio.php' (include_path = '.: / opt / lampp / lib / php') in /opt/lampp/htdocs/festivalvallenato/index.php on line 12
In linux I also use the xamp, and I keep the same windows project in linux but I do not know why it generates the error.
This is my index.php, I appreciate your help. Thanks.
// Pequeña lógica para capturar la pagina que queremos abrir
$pagina = isset($_GET['p']) ? strtolower($_GET['p']) : 'inicio';
// El fragmento de html que contiene la cabecera de nuestra web
require_once 'header.php';
/* Estamos considerando que el parámetro enviando tiene el mismo nombre del archivo a cargar, si este no fuera así
se produciría un error de archivo no encontrado */
require_once '/' . $pagina. '.php';
// Otra opción es validar usando un switch, de esta manera para el valor esperado le indicamos que página cargar
// El fragmento de html que contiene el pie de página de nuestra web
require_once 'footer.php';