Welcome Guest, Not a member yet? Register   Sign In
Parse error including vendor/autoload.php
#4

If you're just putting the call to load the Composer autoloader straight into your index.php file, I would recommend moving the call above the require_once() call to CodeIgniter.php and try something like this:

PHP Code:
           if (file_exists(APPPATH 'vendor/autoload.php')) {
 
               require_once(APPPATH 'vendor/autoload.php');
 
           } elseif (file_exists(APPPATH '../vendor/autoload.php')) {
 
               require_once(APPPATH '../vendor/autoload.php');
 
           

You can take out the conditional which doesn't apply to the location of your autoloader, I simply copied this from what I use within Bonfire (though I load it in a hook so I can use the same config setting which is used in CI3).

If you put it after the call to CodeIgniter.php in your index.php file, it's too late to autoload anything.
Reply


Messages In This Thread
RE: Parse error including vendor/autoload.php - by mwhitney - 03-30-2015, 10:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB