I know, that's stupid, but I can't solve the problem with my project.
I wrote project on WAMP firstly and all works.
After, I try to migrate on live server, and find a problem - server don't require my files.
Project structure is:
application
core
Controller.php
Model.php
View.php
Route.php
models
views
controllers
included
config.php
app.php
index.php
when I try to run it, server return error:
Warning: require_once(core/model.php): failed to open stream: No such file or directory in /home/u224052355/public_html/application/app.php on line 4
This is the app.php code:
session_start();
require_once 'config.php';
require_once 'core/model.php';
require_once 'core/view.php';
require_once 'core/controller.php';
require_once 'core/route.php';
spl_autoload_register(function($class_name){
include 'included/' . $class_name . '.php';
});
Route::start();
When I try solve this by adding __DIR__
to require_once I gave this message:
Warning: require_once(/home/u224052355/public_html/application/core/model.php): failed to open stream: No such file or directory in /home/u224052355/public_html/application/app.php on line 4
Fatal error: require_once(): Failed opening required '/home/u224052355/public_html/application/core/model.php' (include_path='.:/opt/php-5.5/pear') in /home/u224052355/public_html/application/app.php on line 4
Using the $_SERVER['DOCUMENT_ROOT']
and etc. - same result.
How can I solve this problem?