zgluis
zgluis

Reputation: 3355

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:

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

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

Warning: require_once(/home/u327900732/public_html/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_once(): Failed opening required '/home/u327900732/public_html/core/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!

Upvotes: 2

Views: 2271

Answers (1)

Latif Rahmat
Latif Rahmat

Reputation: 98

Trying to use complete url to test your url. Or check in your browser to check the file exist or not. Like here:

http://host.com/core/libs/smarty/Smarty.class.php

I think it will show error that show your file isn't exist there.

Upvotes: 0

Related Questions