Skip to main content

Problems with deployment GIT Laravel

Comments

7 comments

  • cPRex Jurassic Moderator
    Hey there! I'm wondering if there is an issue with the path as /home/username/app in the DEPLOYPATH setting may end up giving you the result of /home/username/app/app once deployed. Can you check that and see if adjusting that makes a difference?
    0
  • n212
    Hi I just managed to fix it. I made a repository path inside cpanel, put the .cpanel.yml in there and now it deploys to my app folder. Do you know if this is possible to do via github instead of my local cpanel repository. That would be ideal
    0
  • cPRex Jurassic Moderator
    That part I'm not sure - you'd have to check things on the github side and do some testing to see if that is an option.
    0
  • ThiagoOrtega
    Sorry to invade your post @n212, but I saw that you are already using laravel, would you know how to guide me? Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException The GET method is not supported for this route. Supported methods: POST. we have a problem with the application running on our server (which is shared). the Laravel version is 8, but the views are made on the blade, with few things in ajax. the situation: the first time I deployed, I put Laravel in a folder at the root of the server (a directory above the default public_html folder). and then I removed the public_html folder and created a symbolic link to the Laravel public folder (I also had the correct permissions on the Laravel folder, storage and files, all as the tutorial said). in the login form, when done, there was an error saying that the route did not accept the GET method, only POST; it turns out that I was using POST (with csrf in the form and everything), but something, I don't know if in the way I structured the folders or other configuration, there was a kind of redirection and the method was changed. from what I realized the script doesn't even reach the controller layer, the error happens before. After much research, I found an apparent solution: I put the application inside the standard public_html folder, and in that public_html folder I used a .htaccess that redirected to Laravel's public folder; being .htaccess: RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?dominio.com.br$ RewriteCond %{REQUEST_URI} !^/laravel/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /laravel/public/$1 RewriteCond %{HTTP_HOST} ^(www.)?dominio.com.br$ RewriteRule ^(/)?$ laravel/public/index.php [L]
    doing so the application worked correctly, but only with HTTP. when I switched to running with HTTPS, the same previous problem happened again. I have already researched a lot and found few people with the same error, but no concrete solution; remembering that it works correctly locally and with HTTP, so it's not as simple as a basic route error. I also tried to force HTTPS via code and via cpanel, but it also didn't work. Att Thank you
    0
  • cPRex Jurassic Moderator
    @ThiagoOrtega - you can tag other users by using the @ in front of their name to get their attention if you'd like, but hopefully they will provide more details about their configuration as this isn't something that cPanel natively supports.
    0
  • ThiagoOrtega
    @ThiagoOrtega - you can tag other users by using the @ in front of their name to get their attention if you'd like, but hopefully they will provide more details about their configuration as this isn't something that cPanel natively supports.

    Sorted out! The application was not letting use /admin after I changed the post's name it worked correctly.
    0
  • cPDavidL
    Thank you for your update, @ThiagoOrtega, and for sharing with the community! I'm glad you were able to get the issue sorted.
    0

Please sign in to leave a comment.