mardi 12 janvier 2016

PHP Fatal error: require()

I have a website that works perfect in my localhost with xampp, but... I uploaded it to a few free websites hosting (000webhost and hostinger) and when i try to open it, got this message:

Warning: require(core/libs/smarty/Smarty.class.php): failed to open stream: No such file or directory in /home/u327900732/public_html/www/index.php on line 7

Fatal error: require(): Failed opening required 'core/libs/smarty/Smarty.class.php' (include_path='.:/opt/php-5.5/pear') in /home/u327900732/public_html/www/index.php on line 7

This is the code:

    <?php   

session_start();

$view = isset($_GET['view']) ? $_GET['view'] : 'index';

require_once('core/libs/smarty/Smarty.class.php');
require('core/models/class.Conexion.php');

if(file_exists('core/controllers/'.$view.'Controller.php')){
    include('core/controllers/'.$view.'Controller.php');
}else {
    include('core/controllers/errorcontroller.php');
}

?>

I checked that file one hundred times and it is there.

I found and tried this solutions:

  • Changing Require for Include:

Warning: include(core/libs/smarty/Smarty.class.php): failed to open stream: No such file or directory in /home/u327900732/public_html/www/index.php on line 7

Warning: include(): Failed opening 'core/libs/smarty/Smarty.class.php' for inclusion (include_path='.:/opt/php-5.5/pear') in /home/u327900732/public_html/www/index.php on line 7

Fatal error: Class 'Smarty' not found in /home/u327900732/public_html/www/core/controllers/indexController.php on line 3

  • require(chdir(dirname(FILE)) . 'core/libs/smarty/Smarty.class.php');

Warning: require(1core/libs/smarty/Smarty.class.php): failed to open stream: No such file or directory in /home/u327900732/public_html/www/index.php on line 7

Fatal error: require(): Failed opening required '1core/libs/smarty/Smarty.class.php' (include_path='.:/opt/php-5.5/pear') in /home/u327900732/public_html/www/index.php on line 7

I tried adding './' to the path but it still doesn't work. I repeat, the site works perfect in my localhost. Help please!




Aucun commentaire:

Enregistrer un commentaire