[GH-ISSUE #265] What files to 'require'? #85

Closed
opened 2026-03-04 02:12:03 +03:00 by kerem · 1 comment
Owner

Originally created by @rightaway on GitHub (Nov 3, 2013).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/265

I have manually required "monolog/src/Monolog/Logger.php" in my application (not using Composer) and get a "PHP Fatal error: Interface 'Psr\Log\LoggerInterface' not found in /path/to/monolog/src/Monolog/Logger.php on line 28" when running the application.

I figured I need to download this library (https://github.com/php-fig/log) and so also required "log/Psr/Log/LoggerInterface.php" but was getting the same problem.

How can I use monolog without Composer, instead just by requiring the right files?

Originally created by @rightaway on GitHub (Nov 3, 2013). Original GitHub issue: https://github.com/Seldaek/monolog/issues/265 I have manually required "monolog/src/Monolog/Logger.php" in my application (not using Composer) and get a "PHP Fatal error: Interface 'Psr\Log\LoggerInterface' not found in /path/to/monolog/src/Monolog/Logger.php on line 28" when running the application. I figured I need to download this library (https://github.com/php-fig/log) and so also required "log/Psr/Log/LoggerInterface.php" but was getting the same problem. How can I use monolog without Composer, instead just by requiring the right files?
kerem closed this issue 2026-03-04 02:12:04 +03:00
Author
Owner

@adlawson commented on GitHub (Nov 3, 2013):

@rightaway If you don't want to manually require all files (and you shouldn't) and you don't want to use composer to manage your autoloading, you should implement your own autoloader.

See the PHP docs for spl_autoload_register and the example autoloader implementation in PSR-0.

<!-- gh-comment-id:27655527 --> @adlawson commented on GitHub (Nov 3, 2013): @rightaway If you don't want to manually require all files (and you shouldn't) and you don't want to use composer to manage your autoloading, you should implement your own autoloader. See the PHP docs for [`spl_autoload_register`](http://php.net/manual/en/function.spl-autoload-register.php) and the example autoloader implementation in [`PSR-0`](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md#example-implementation).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#85
No description provided.