LaravelのプロジェクトをMAMPかXAMPPを使って表示したいのですが,できないので教えていただきたいです.以前まではMAMPを使用して問題なく表示をすることができていました.
現在はMacを使用しており,macOS Montereyのバージョン12.3.1です.
また,composerのバージョンは2.3.7です.
MAMP
以前までに作成したlaravelのプロジェクト(laravelapp)は今でも問題なくgoogle Chromeを使用して表示することができます.以前に作成したもののバージョンは以下のとおりです.
- laravelのバージョン 9.6.0
- MAMPのPHPのバージョン 8.0.8
- パソコンのPHPのバージョン 8.1.1
また,新しく作成したプロジェクトのバージョンは以下のとおりです.
- laravelのバージョン 9.18.0
- MAMPのPHPのバージョン 8.0.8
- パソコンのPHPのバージョン 8.1.1
新しく作成したプロジェクトに(http://localhost/laravelSample/public/) でアクセスしようとしたら以下のようなエラーが出ます.
エラー内容
Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 8.0.8. in /Applications/MAMP/htdocs/laravelSample/vendor/composer/platform_check.php on line 24```
試したこと
laravelのバージョンが問題かと思い9.6.0のバージョンで作成しようとしたのですが作成方法がわからず,(composer create-project --prefer-dist laravel/laravel=8.* laravelSample8)のコマンドで8.83.17のバージョンのプロジェクトを作成しました.
その結果は,同じく上記のエラーが出ました.
また,MAMPproを使用してPHPのバージョンが8.1.0以降のものにするのはできれば避けたいです.
ですので次にXAMPPを使用しようとしました.
XAMPP
XAMPPはxampp-osx-8.1.6-0-vmをダウンロードしました.
htdocsにlaravelのプロジェクト(バージョンは9.18.0)(プロジェクト名はtest9)を作成し,(http://localhost:8080/test9/public/) でアクセスしようとしたら以下のエラーが出てきました.
エラー内容
The stream or file "/opt/lampp/htdocs/test9/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/test9/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/test9/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/test9/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/test9/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/test9/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/test9/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/test9/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/test9/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/test9/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/test9/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/test9/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/test9/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/test9/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/test9/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/test9/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: file_put_contents(/opt/lampp/htdocs/test9/storage/framework/views/358427817b4c28094d977956fd5179e449217ffe.php): Failed to open stream: Permission denied Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}}
試したこと
作成したlaravelのプロジェクトに問題があるのではないかと思い,作成したlaravelのプロジェクトでphp artisan serveのコマンドを使用し,(http://127.0.0.1:8000) にアクセスしたところ問題なくlaravelの初期のページが表示されました.
laravelとMAMPやXAMPPを最近触り始めたので初歩の質問かもしれませんが,よろしくお願い致します.


