Search code examples
laravellaravel-5cpanellaravel-5.5

Uploading images to Public_html file rather than public project file


Had this working but just updated my website on the server and it seems to have made all my uploaded files head to my public folder in my project rather than the public_html. Any idea on which file i must have uploaded and the fix?


Solution

  • You said you had it working before. Was that on the same server...live?

    If so, then could that be a server issue and not necessarily laravel issue? Maybe you should ask your host for help and clarifications about what changed?

    If you are convinced it was about what you changed...then care to show us? Ideally if the server is cpanel, you will want to upload all your laravel files into your home's directly...then all your /public folder content into public_html It will look like this:

    • .cpanel/

    • app/

    • etc/
    • bootstrap/
    • mail/
    • public_html/
      • content from your laravel /public directory
    • vendor/

    ...etc

    You also need to go into your /public_html and edit the index.php content:

    require __DIR__.’/../vendor/autoload.php’;
    
    $app = require_once __DIR__.’/../bootstrap/app.php’;
    

    And make sure it points to the correct location of your bootstrap folder..if you follow the structure above, then its ok.

    Lastly, confirm that your PHP is indeed >= PHP7.0