Answer the question
In order to leave comments, you need to log in
Why doesn't realpath work on CentOS?
A simple autoloader that worked for me on Windows:
spl_autoload_register(
function($class_address)
{
$path = __DIR__ . DIRECTORY_SEPARATOR . $class_address . '.php';
require_once realpath($path);
},
true, true
);
$path = __DIR__ . DIRECTORY_SEPARATOR . $class_addr . '.php';
echo 'Original path is: ', $path . PHP_EOL;
$path = realpath($path);
echo 'After realpath: ' . var_export($path, true);
Original path is: /var/www/vendor/asoft\kernel\Kernel.php
After realpath: false
Answer the question
In order to leave comments, you need to log in
And where is it written that realpath should fix slashes?
On Linux, it is quite normal to have a file named "\kernel\Kernel.php"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question