Codeigniter and Composer psr-4 |
Hi guys
composer.json Code: { application/libraries PHP Code: <?php application/controllers PHP Code: <?php PHP Code: Fatal error: Class 'App\Libraries\Welcome_library' not found What am I doing wrong. Thanks
Setting it to TRUE means that it will look for application/vendor/autoload.php
Is that the correct path for your setup? If not, set it to the path to the autoload.php file.
(03-15-2017, 02:57 AM)Narf Wrote: Setting it to TRUE means that it will look for application/vendor/autoload.php Thanks Narf. I just forgot to add to the index.php PHP Code: require FCPATH.'vendor'.DIRECTORY_SEPARATOR.'autoload.php';
There are 2 ways. One is a simple change to your config. The other is including a link in your index.php. Changing the config is the best because it doensn't breaak the coding commandment: "Thou shalt not hack thine core".
Method 1: Change the following in application/config/config.php. $config['composer_autoload'] = './vendor/autoload.php'; (or where ever your autoload.php is located) Method 2: You can also add include_once './vendor/autoload.php'; to index.php as per Phil Sturgeon's blog https://philsturgeon.uk/php/2012/05/07/c...deigniter/
Removed from index.php and set in config $config['composer_autoload'] = 'vendor/autoload.php';
Everything works fine, thanks. This is all my inattention.
(03-16-2017, 04:51 AM)llebkered Wrote: There are 2 ways. One is a simple change to your config. The other is including a link in your index.php. Changing the config is the best because it doensn't breaak the coding commandment: "Thou shalt not hack thine core". Thanks, understood |
Welcome Guest, Not a member yet? Register Sign In |