Welcome Guest, Not a member yet? Register   Sign In
vendor/autoload.php not execute with multiple applications?
#1

(This post was last modified: 12-10-2021, 06:51 AM by mylastof.)

anyone can help to resolve COMPOSER_PATH with multiple application?
vendor/autoload.php cant load,
I have edit COMPOSER_PATH (...\site1\app\Config\Constants.php) but still not work ...

test repo: https://github.com/totoprayogo1916/ci4-multi

closed issue but not resolve https://github.com/codeigniter4/CodeIgni...ssues/4887
Reply
#2

FYI: I Just edit COMPOSER_PATH to
Code:
__DIR__ . '../../../../vendor/autoload.php'
but it goes HTTP ERROR 500
Reply
#3

PHP Code:
diff --git a/composer.json b/composer.json
index a229da3
..744ab71 100644
--- a/composer.json
+++ b/composer.json
@@ -19,10 +19,@@
        "ext-fileinfo""Improves mime type detection for files"
    },
    "autoload": {
-
        "psr-4": {
-
            "App\\""app",
-
            "Config\\""app/Config"
-        },
        "exclude-from-classmap": [
            "**/Database/Migrations/**"
        ]
diff --git a/site1/app/Config/Constants.php b/site1/app/Config/Constants.php
index 8f8498a
..302e19c 100644
--- a/site1/app/Config/Constants.php
+++ b/site1/app/Config/Constants.php
@@ -23,+23,@@ defined('APP_NAMESPACE') || define('APP_NAMESPACE''App');
  The path that Composer's autoload file is expected to live. By default,
  | the vendor folder is in the Root directory, but you can customize that here.
  */
-defined('
COMPOSER_PATH') || define('COMPOSER_PATH', ROOTPATH . 'vendor/autoload.php');
+defined('
COMPOSER_PATH') || define('COMPOSER_PATH', ROOTPATH . '../vendor/autoload.php');
+define('
VENDORPATH', realpath(ROOTPATH . '../vendor') . DIRECTORY_SEPARATOR);

/*
  |-------------------------------------------------------------------------- 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB