1
votes

I m getting thiserror`

Fatal error: require(): Failed opening required '/home/goboot5e/public_html/myproject/vendor/composer/../../App/Http/helpers.php' (include_path='.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php') in /home/goboot5e/public_html/myproject/vendor/composer/autoload_real.php on line 66

when i have uploaded my project to the server(made live)

the things i have changed are(was working perfect on localhost):

  1. copied all public files into server root ie public_html

  2. database configured through .env file

  3. changed path in the index.php(now public_html/index.php)

Most importantly i have made a custom helpers.php which is located in App/Http/helpers.php

my composer.json file autoload look like this

"autoload": {
        "classmap": [
            "database"
        ],

        "files": [
            "App/Http/helpers.php"
        ], 
        "psr-4": {
            "App\\": "app/"
        }
    },

Please help me thanks in advance!!!

2
try this command: composer dump-autoloadJigar Shah
it works absolutely fine on localhost without a single erroruser6132631
@JigarShah, after executing composer dump-autoload only i have uploadeduser6132631

2 Answers

9
votes

Try this. This problem occurs because laravel folder name is app but you use App. It works fine on localhost because windows OS is not case sensitive but linux is case sensitive. May be your PC is windows and server is linux

"files": [
            "app/Http/helpers.php"
        ],

After changing run composer dump-autoload and upload your project again

Note : You can now upload only composer folder (vendor\composer) and autoload.php (vendor\)

0
votes

Check the spelling of the files names. your localhost's filesystem is case-insensitive, while the server is not.

double check that all names casing match with composer.json.

For example, if helpers.php is Helpers.php composer will not find the file.