dockerでPHPコンテナに入り、bakeコマンドでコントローラーを実行しようとすると、以下のようにbad interpreter: Permission deniedエラーが発生して、bakeコマンドが通らない状況です。
これを解決し、bakeコマンドが使えるようになりたいです。
phpのバージョン8系
cakephp4系
bakeコマンドでbash: bin/cake: /usr/bin/env: bad interpreter: Permission deniedと権限エラー?が発生する
# bin/cake bake controller ItemsController bash: bin/cake: /usr/bin/env: bad interpreter: Permission denied
ちなみに、lsコマンドで確認すると、以下のようにcakephpのソースは入っています。
composer installは実行済みです。
# ls README.md composer.json config logs phpstan.neon plugins src tests vendor bin composer.lock index.php phpcs.xml phpunit.xml.dist resources templates tmp webroot
bin/cakeファイルにも、
#!/usr/bin/env sh ################################################################################ # # Cake is a shell script for invoking CakePHP shell commands # # CakePHP(tm) : Rapid Development Framework (https://cakephp.org) # Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) # # Licensed under The MIT License # For full copyright and license information, please see the LICENSE.txt # Redistributions of files must retain the above copyright notice. # # @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) # @link https://cakephp.org CakePHP(tm) Project # @since 1.2.0 # @license https://opensource.org/licenses/mit-license.php MIT License # ################################################################################ # Canonicalize by following every symlink of the given name recursively canonicalize() { NAME="$1" if [ -f "$NAME" ]
このようにソースあります。
## 試したこと
composer install
→実行できた。
which envで以下のようにenvあること確認。
# which env /usr/bin/env
#! /usr/bin/envつけると解決するといった内容があったので、
ディレクトリ# #!/usr/bin/env sh bin/cake controller ItemsController とか、 ディレクトリ# #!/usr/bin/env bin/cake controller ItemsController
何も変化ない。(何もエラーメッセージとかないし、ファイルも作成されない。)
ほかに解決方法あればお願いいたします。

あなたの回答
tips
プレビュー