Giter Club home page Giter Club logo

Comments (7)

rennokki avatar rennokki commented on August 27, 2024 1

Windows Bash acts different because it emulates the UNIX CLI, but the filesystem is still turned upside down. Use Ubuntu on Windows 10 from the Store to access the files and chmod them: https://www.microsoft.com/store/productId/9N6SVWS3RX71

from laravel-aws-eb.

yurik94 avatar yurik94 commented on August 27, 2024 1

Resolved by using .ebextensions rather than .sh hooks

option_settings:
  - namespace: aws:elasticbeanstalk:application:environment
    option_name: COMPOSER_HOME
    value: /root

  - namespace: aws:elasticbeanstalk:container:php:phpini
    option_name: document_root
    value: /public

  - namespace: aws:elasticbeanstalk:container:php:phpini
    option_name: memory_limit
    value: 256M

commands:
  00_php_ini_bak:
    command: cp /etc/php.ini /etc/php.ini.bak

  01_install_pecl_redis:
    command: |
      pecl install redis
      echo "extension=redis.so" | tee /etc/php.d/50-redis.ini
    test: "php -r \"exit(extension_loaded('redis') ? 1 : 0);\""

  02_install_pecl_ev:
    command: |
      pecl install ev
      echo "extension=ev.so" | tee /etc/php.d/50-ev.ini
    test: "php -r \"exit(extension_loaded('ev') ? 1 : 0);\""

  03_php_ini_restore:
    command: cp /etc/php.ini.bak /etc/php.ini

container_commands:
  01_copy_env_file:
    command: |
      touch .env
      echo "APP_ENV=beanstalk" > .env
      chown webapp:webapp .env

  02_chmod_folders:
    command: |
      chmod -R 777 storage/
      chmod -R 777 bootstrap/cache/
      mkdir storage/framework/cache
      mkdir storage/framework/views
      chown webapp:webapp storage/logs
      chown webapp:webapp storage/framework/*

  03_install_composer_dependencies:
    command: |
      /usr/bin/composer.phar self-update
      php /usr/bin/composer.phar install --no-dev --no-interaction --prefer-dist --optimize-autoloader

  04_link_storage_folder:
    command: php artisan storage:link # not needed as we are using S3

  05_systemctl_restart_nginx:
    command: systemctl restart nginx

from laravel-aws-eb.

yurik94 avatar yurik94 commented on August 27, 2024

Another question...

2020/05/17 22:03:01.905016 [ERROR] An error occurred during execution of command [app-deploy] - [Install composer dependencies]. Stop running the command. Error: Installing composer dependencies failed with error: Command /bin/sh -c composer.phar install --no-ansi --no-interaction failed with error exit status 1. Stderr:Do not run Composer as root/super user! See https://getcomposer.org/root for details

Within 01_install_composer_dependencies you are installing dependencies as root which is not recommended, right?

from laravel-aws-eb.

rennokki avatar rennokki commented on August 27, 2024

Hey!

According to this: #6, sudo should be used to avoid any errors regarding the install.

The errors related to .platform/hooks/prebuild/update_composer.sh: permission denied are because you didn't make the shell scripts executable before deploying them:

from laravel-aws-eb.

rennokki avatar rennokki commented on August 27, 2024

Yes, this is a workaround. 👀

If you check the diff between master and amazon-ami branch, you can see that most of the commands were moved to .platform/ since i tought it is a good idea to make use of this AL2 feature. 😅

from laravel-aws-eb.

MarkusJLechner avatar MarkusJLechner commented on August 27, 2024

i made a posting in aws forum.

there are too many reasons for this problem. one of the reasons is deploying from a windows machine

image

from laravel-aws-eb.

rennokki avatar rennokki commented on August 27, 2024

Consider running the commands using WSL if you got Windows 10 or your CI/CD pipeline instead before deploying it.

from laravel-aws-eb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.