Deploy Laravel to DigitalOcean

Поделиться
HTML-код
  • Опубликовано: 4 сен 2024

Комментарии • 53

  • @cosmeescobedo
    @cosmeescobedo  3 года назад

    Get $100 in digital ocean credits: m.do.co/c/71d7fa9ca3d3

  • @md.sajidulhaque9243
    @md.sajidulhaque9243 Год назад

    wow, so easy as butter, how on earth could anything be that easy I don't understand.

  • @hassanabdullah5400
    @hassanabdullah5400 2 года назад +1

    you are awesome man. Hitting right to spot

  • @naymyomhan
    @naymyomhan Год назад +1

    Your tutorial is very help full for me, thank you so much

  • @barrymejico9617
    @barrymejico9617 2 года назад +4

    I don't know why but I received the error 502 Bad Gateway.

    • @jaspervandijk27
      @jaspervandijk27 Год назад

      Did you fix it?

    • @jaspervandijk27
      @jaspervandijk27 Год назад

      I found the errror
      Check your nginx configuration, fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; This could be version 8.0

  • @ryanisthewind
    @ryanisthewind 2 года назад +1

    WOW, such a great tutorial!
    but man I really need to learn Linux, I had enough.

  • @showmore5941
    @showmore5941 2 года назад +2

    I successfully deploy it, but it my JS & CSS file are not permitted to load, in my console log it shows me `net::ERR_ABORTED 403 (Forbidden)`

    • @cosmeescobedo
      @cosmeescobedo  2 года назад

      Hi, maybe you need to change the permissions on those files to be accessible by the nginx try sudo chown -R www-data.www-data path/to/your/css do that also for your js

  • @BardichTech
    @BardichTech 2 года назад

    Greate Job & Clean Work, Thanks a lot and good luck

  • @ryanm.122
    @ryanm.122 Год назад +1

    Stuck @15:48 - Any ideas why I can mysql -u app -p and use the password in my .env file just fine, create the database and everything else, but when I run php artisan migrate --force, I get SQLSTATE[HY000] [1045] Access denied for user 'app'@'localhost' (using password: YES) (SQL: select * from information_schema.tables where table_schema = bogm and table_name = migrations and table_type = 'BASE TABLE')? I have checked the env DB_DATABASE, DB_USERNAME and DB_PASSWORD more times that I can remember and literally copy and paste to log into mysql, but it doesn't work to migrate...
    The only thing that ended up working was running sudo cat /etc/mysql/debian.cnf and using the debian-sys-maint credentials in my .env ...

    • @cosmeescobedo
      @cosmeescobedo  Год назад +1

      Hey, maybe you have old config cache, try running `php artisan config:clear` to clean it, hope it helps.

    • @drugoviic
      @drugoviic 5 месяцев назад +1

      i had the same problem but after 4 hours of debugging and research i found out i had used a password that collided with the .env syntax, i had to wrap it in quotation marks and it worked, example >pass: #iLoveK0ala and in .env DB_PASSWORD=#iLoveK0ala will throw an error as everything after the hashtag is ignored as a comment,

  • @faizmuhammadalauddin8775
    @faizmuhammadalauddin8775 Год назад +1

    great job, thank you

  • @kevinwakhisi7001
    @kevinwakhisi7001 2 года назад +1

    Quick question, how can i tansfer domain names to this server?

  • @Jafear
    @Jafear 2 года назад

    great job🙏🏽

  • @gregherrick4013
    @gregherrick4013 2 года назад +1

    Thanks for the video! When I update my code locally, and then push to Git, how do I update the site with new git commit??

    • @cosmeescobedo
      @cosmeescobedo  2 года назад +2

      you just do git pull in the server and it should update. If you add more composer packages or migrations you have to run those commands again in the server as well.

  • @aymanmalhattami
    @aymanmalhattami 2 года назад

    Thanks a lot 😍

  • @abdinassirmuse4991
    @abdinassirmuse4991 6 месяцев назад

    Thanks

  • @MenAmongTheRuins77
    @MenAmongTheRuins77 6 месяцев назад

    how would you update it ? would u just do git pull on the linux ?

    • @cosmeescobedo
      @cosmeescobedo  6 месяцев назад +1

      You can do that, but I wrote an article a couple of years ago where I show how I do it cosme.dev/post/zero-down-deployment-for-laravel-apps

  • @tasneemwahdan3618
    @tasneemwahdan3618 4 месяца назад

    Thank you! followed the steps and everything is great! but at last, I got: 502 Bad Gateway on the browser. can you help me, please?

    • @cosmeescobedo
      @cosmeescobedo  4 месяца назад +1

      You might have another version of fpm installed, make sure the php-fpm path that you added to the nginx file exists, if it doesn’t change to the one that exist within the same path (probably same name different version number)

    • @tasneemwahdan3618
      @tasneemwahdan3618 4 месяца назад

      @@cosmeescobedo yes! fpm did not exist. I installed it and the website is working finally. Thank you!
      Now it seems that all styling are not applied, and only homepage loads successfully. All other links give 403 forbidden response. May you help me again, please?
      🙈

    • @cosmeescobedo
      @cosmeescobedo  4 месяца назад

      Is it a Laravel forbidden or an nginx forbidden? If it’s nginx you should be able to see the error in the nginx logs, I don’t remember where the log file is located tho, if it’s Laravel then it’s something to do with your code or you can look at your app’s logs

    • @tasneemwahdan3618
      @tasneemwahdan3618 4 месяца назад

      @@cosmeescobedo when I removed deny all; part in available sites file, everything worked! I am not an expert, so I am worried that removing it is dangerous. Please give me an advice. Thanks a lot for helping

  • @uweopfern
    @uweopfern Год назад

    Getting 403 forbidden where as i have provided permissions to public and other folderls

    • @cosmeescobedo
      @cosmeescobedo  Год назад

      Hey, make sure to check the logs under /var/log/nginx/error.log that might point you in the right direction

  • @Jafear
    @Jafear 2 года назад

    Do you do some work on the side. I have a problem with Error 500…. I’m looking for someone to do the work.

    • @cosmeescobedo
      @cosmeescobedo  2 года назад

      Hi, sorry, but not right now, hope you find help!

    • @jaspervandijk27
      @jaspervandijk27 Год назад

      Check your nginx configuration, fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; This could be version 8.0

  • @fabsync
    @fabsync Год назад

    fantastic tutorial! I am getting this error when I tried to set up a password for mysql.. after entering: sudo mysql_secure_installation
    Failed! Error: SET PASSWORD has no significance for user 'root'@'localhost' as the authentication method used doesn't store authentication data in the MySQL server. Please consider using ALTER USER instead if you want to change authentication parameters
    any idea how to fix this?

    • @fabsync
      @fabsync Год назад +1

      here is what worked:
      1. close terminal
      2. ssh back again into the server
      3. sudo mysql
      4. enter this command once you are inside the msql:
      alter user root@localhost identified with mysql_native_password by 'yourpassword';
      5. enter -> flush privileges;
      6. exit
      7. and then continue with: sudo mysql_secure_installation

    • @cosmeescobedo
      @cosmeescobedo  Год назад

      @@fabsync Hey sorry for not replying, I'm glad you figured it out, thanks for commenting for the next person 😁

  • @pressfive
    @pressfive Год назад

    Even though I followed all the steps perfectly, I still get the: refused to connect.
    Try:
    Checking the connection
    Checking the proxy and the firewall
    ERR_CONNECTION_REFUSED
    Error

    • @cosmeescobedo
      @cosmeescobedo  Год назад

      Please check the nginx logs in /var/logs/nginx/error.log

  • @a.chillstechnologies9952
    @a.chillstechnologies9952 2 года назад

    Please do they charge you seperately for the database there

    • @cosmeescobedo
      @cosmeescobedo  2 года назад +1

      You can buy a separate database if you want, but you can also set up a database in the same server without additional cost. The way I did it in this tutorial, it won't generate additional charges

    • @a.chillstechnologies9952
      @a.chillstechnologies9952 2 года назад

      @@cosmeescobedo ok sir thank you

  • @user-cx1yc4pt8p
    @user-cx1yc4pt8p Год назад

    your video is great, but in description there is a spelling mistake 'sudo chown -R www-data.www-data boostrap/cache' **bootstrap**, but very helpful video.

  • @oseiasisidoro1014
    @oseiasisidoro1014 3 года назад

    ip/login 403 Forbidden

    • @uweopfern
      @uweopfern Год назад

      me too, tried different permission granted commands, and didn't work

  • @user-jt3zn9ju5g
    @user-jt3zn9ju5g 2 года назад

    why this error
    sudo service nginx restart
    Job for nginx.service failed because the control process exited with error code.
    See "systemctl status nginx.service" and "journalctl -xe" for details.

  • @sandradanielsson4680
    @sandradanielsson4680 2 года назад

    Hey! Thanks for the tutorial, very easy to follow! But I ran into an issue unfortunately.
    I did every step and everything seemed to work fine (the only thing I didnt do was to make me able to ssh into my new user directly and also the mysql install since I already had it).
    When I try to reach my site via the ip address now I get the 502 Bad Gateway error and I wonder if you have any clue as to where the issue could originate? It's such a general error message and I'm very new to deployment in general, and first time using Nginx, so any help is appreciated!
    nginx/error.log shows nothing, and I double-checked that the IP address is correct in the nginx configuration

    • @cosmeescobedo
      @cosmeescobedo  2 года назад

      Hi, sorry about your problem, are you checking the error log in /var/log/nginx/? Also can you check your Laravel logs as well? I doubt that's the issue but maybe you can find more information there, let me know if you're still having issues

    • @motorsportformula1motorgpr816
      @motorsportformula1motorgpr816 2 года назад

      Did you manage to sort this?
      I'm getting a 521 error yet everything seems like it should be okay

    • @motorsportformula1motorgpr816
      @motorsportformula1motorgpr816 2 года назад

      @Sandra Danielson did you manage... I found the solution

    • @gaganadhikari1958
      @gaganadhikari1958 2 года назад

      @@motorsportformula1motorgpr816 hey mate i have the same issue can you help me with it?

    • @himaliamit8698
      @himaliamit8698 Год назад +1

      in .env you must replace app_debug:true inorder to view the error and not get the generic error of 500 server.

  • @biesys
    @biesys 2 года назад

    Hello Cosme. I am using Digital Ocean Ubuntu 20.04. I had to install PHP 7.2 for my project to work since "composer install" was failing since my current version was a lot newer. Now "php artisan key:generate" fails: myuser@myproject:/var/www/amit$ php artisan key:generate
    PHP Fatal error: Uncaught ErrorException: Method ReflectionParameter::getClass() is deprecated in /var/www/amit/vendor/laravel/framework/src/Illuminate/Container/Container.php:873
    What do you recommend ? Thank You !!

    • @Mohamed-sr1qk
      @Mohamed-sr1qk 2 года назад +1

      This problem I found solution for Update php8.1