質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Laravel

LaravelとはTaylor Otwellによって開発された、オープンソースなPHPフレームワークです。Laravelはシンプルで表現的なシンタックスを持ち合わせており、ウェブアプリケーション開発の手助けをしてくれます。

nginx

nginixは軽量で高性能なwebサーバーの1つです。BSD-likeライセンスのもとリリースされており、あわせてHTTPサーバ、リバースプロキシ、メールプロキシの機能も備えています。MacOSX、Windows、Linux、上で動作します。

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

zsh

zshは、UNIX系OSのシェルの1つです。 cshやksn系のコマンドライン編集機能も実装されたシェルです。

MAMP

Mac 上で WordPress などの動的ページのサイトが作れるように環境を構築するフリーソフト

Q&A

解決済

1回答

2748閲覧

zshシェルにpathが通っているかわからない(MAMP&Laravel使用にあたって)

退会済みユーザー

退会済みユーザー

総合スコア0

Laravel

LaravelとはTaylor Otwellによって開発された、オープンソースなPHPフレームワークです。Laravelはシンプルで表現的なシンタックスを持ち合わせており、ウェブアプリケーション開発の手助けをしてくれます。

nginx

nginixは軽量で高性能なwebサーバーの1つです。BSD-likeライセンスのもとリリースされており、あわせてHTTPサーバ、リバースプロキシ、メールプロキシの機能も備えています。MacOSX、Windows、Linux、上で動作します。

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

zsh

zshは、UNIX系OSのシェルの1つです。 cshやksn系のコマンドライン編集機能も実装されたシェルです。

MAMP

Mac 上で WordPress などの動的ページのサイトが作れるように環境を構築するフリーソフト

0グッド

0クリップ

投稿2020/05/23 14:49

よろしくお願いいたします。

LarabelをMAMPサーバー(Nginxで考えております。)で使用するため色々と試したのですが、エラーが発生してしまっていたため、
調べていくと色々な問題点がありそうでした。

  • Apache couldn't be started. Please check your MAMP installation and configuration.
  • Nginxサーバーの場合はエラー文などは無反応でサーバーに緑の点灯なし

ありうる問題点

1.zshシェルの設定
2.phpとNginxのpathをしっかり通せていない
3.MAMPのポート番号


現状はhomebrewより

  • phpはインストール済み(php 7.4) *バージョン最新ですがphp -v実行で以下のように出てしまいます。

html

1PHP 7.3.18 (cli) (built: May 14 2020 10:54:44) ( NTS ) 2Copyright (c) 1997-2018 The PHP Group 3Zend Engine v3.3.18, Copyright (c) 1998-2018 Zend Technologies 4 with Zend OPcache v7.3.18, Copyright (c) 1999-2018, by Zend Technologies
  • nginx/1.17.10

pathがだいぶおかしな状況になっていると思われますが、どうすれば良いのかわからず困っております。

echo $PATH確認で以下

html

1 $PATH 2“/usr/local/opt/php@7.3/sbin:/usr/local/opt/php@7.3/bin:/usr/local/opt/php@7.3/sbin:/usr/local/opt/php@7.3/bin:/usr/local/opt/php@7.2/bin:/Users/admin/.composer/vendor/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/admin/.composer/vendor/bin:/Users/admin/.composer/vendor/bin:/usr/local/Cellar/postgresql/12,1”

記事などを調べているとzshにpathを通す際にopen .zshrcで開いた内容と私の方で開いた内容にかなり違いがあるように感じます。

開くと以下

html

1# If you come from bash you might have to change your $PATH. 2# export PATH=$HOME/bin:/usr/local/bin:$PATH 3 4# Path to your oh-my-zsh installation. 5export ZSH="/Users/admin/.oh-my-zsh" 6 7# Set name of the theme to load --- if set to "random", it will 8# load a random theme each time oh-my-zsh is loaded, in which case, 9# to know which specific one was loaded, run: echo $RANDOM_THEME 10# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes 11ZSH_THEME="robbyrussell" 12 13# Set list of themes to pick from when loading at random 14# Setting this variable when ZSH_THEME=random will cause zsh to load 15# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/ 16# If set to an empty array, this variable will have no effect. 17# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) 18 19# Uncomment the following line to use case-sensitive completion. 20# CASE_SENSITIVE="true" 21 22# Uncomment the following line to use hyphen-insensitive completion. 23# Case-sensitive completion must be off. _ and - will be interchangeable. 24# HYPHEN_INSENSITIVE="true" 25 26# Uncomment the following line to disable bi-weekly auto-update checks. 27# DISABLE_AUTO_UPDATE="true" 28 29# Uncomment the following line to automatically update without prompting. 30# DISABLE_UPDATE_PROMPT="true" 31 32# Uncomment the following line to change how often to auto-update (in days). 33# export UPDATE_ZSH_DAYS=13 34 35# Uncomment the following line if pasting URLs and other text is messed up. 36# DISABLE_MAGIC_FUNCTIONS=true 37 38# Uncomment the following line to disable colors in ls. 39# DISABLE_LS_COLORS="true" 40 41# Uncomment the following line to disable auto-setting terminal title. 42# DISABLE_AUTO_TITLE="true" 43 44# Uncomment the following line to enable command auto-correction. 45# ENABLE_CORRECTION="true" 46 47# Uncomment the following line to display red dots whilst waiting for completion. 48# COMPLETION_WAITING_DOTS="true" 49 50# Uncomment the following line if you want to disable marking untracked files 51# under VCS as dirty. This makes repository status check for large repositories 52# much, much faster. 53# DISABLE_UNTRACKED_FILES_DIRTY="true" 54 55# Uncomment the following line if you want to change the command execution time 56# stamp shown in the history command output. 57# You can set one of the optional three formats: 58# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" 59# or set a custom format using the strftime function format specifications, 60# see 'man strftime' for details. 61# HIST_STAMPS="mm/dd/yyyy" 62 63# Would you like to use another custom folder than $ZSH/custom? 64# ZSH_CUSTOM=/path/to/new-custom-folder 65 66# Which plugins would you like to load? 67# Standard plugins can be found in ~/.oh-my-zsh/plugins/* 68# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ 69# Example format: plugins=(rails git textmate ruby lighthouse) 70# Add wisely, as too many plugins slow down shell startup. 71plugins=(git) 72 73source $ZSH/oh-my-zsh.sh 74 75# User configuration 76 77# export MANPATH="/usr/local/man:$MANPATH" 78 79# You may need to manually set your language environment 80# export LANG=en_US.UTF-8 81 82# Preferred editor for local and remote sessions 83# if [[ -n $SSH_CONNECTION ]]; then 84# export EDITOR='vim' 85# else 86# export EDITOR='mvim' 87# fi 88 89# Compilation flags 90# export ARCHFLAGS="-arch x86_64" 91 92# Set personal aliases, overriding those provided by oh-my-zsh libs, 93# plugins, and themes. Aliases can be placed here, though oh-my-zsh 94# users are encouraged to define aliases within the ZSH_CUSTOM folder. 95# For a full list of active aliases, run `alias`. 96# 97# Example aliases 98# alias zshconfig="mate ~/.zshrc" 99# alias ohmyzsh="mate ~/.oh-my-zsh" 100export PATH="/usr/local/opt/php@7.3/bin:$PATH" 101export PATH="/usr/local/opt/php@7.3/sbin:$PATH" 102fpath=(/usr/local/share/zsh-completions $fpath)

上記のような内容となっており、他サイトなどで記述されている

html

1# 2# Executes commands at the start of an interactive session. 3# 4# Authors: 5# Sorin Ionescu <************@gmail.com> 6# 7 8# Source Prezto. 9if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then 10 source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" 11fi 12 13# Customize to your needs... 14 15# environment paths(ここでパスを追加します) 16# Larvel 17export PATH="$PATH:$HOME/.composer/vendor/bin" 18#PostgreSQL 19export PATH=“$PATH:/usr/local/Cellar/postgresql/12,1”

このような内容は一切記述がありませんでした.....

MAMPのポート番号に関しては
Apache、Nginxともに80,8889,7999など色々試してみましたがダメでした。
localhost:80でアクセスするとNginxは表示されます。
(localhostと打ち込むとデフォルト設定がlocalhost:8888なので、80ポートに変更したいのですが、
どうすれば良いのかわかりません)

色々といじりすぎてしまったので、それぞれのコマンドや意味合いを把握してから行うべきでした。

  • zsh周りの設定
  • MAMPにおけるphpのバージョン設定
  • 最新のphpがうまくpathを通せていない
  • Nginx関連の設定

根本的な理解ができておらず、質問内容もうまくまとめ切れておらず大変恐縮なのですが、
何かピンときた方などいらっしゃいましたら、アドバイスのほどいただけますと幸いに存じます。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

phpはインストール済み(php 7.4) *バージョン最新ですがphp -v実行で以下のように出てしまいます。
PHP 7.3.18 (cli) (built: May 14 2020 10:54:44) ( NTS )

PATHの先頭に、/usr/local/opt/php@7.3を指定しているのですから、PHP7.3.18が先に見つかって実行されるのは当然ですが。
あなたが環境変数PATHを記述したのではないのですか?

不要なPATHは取り除く、優先したいPATHは前に持ってくるなどして、
編集してください。

投稿2020/05/23 16:24

technocore

総合スコア7225

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

退会済みユーザー

退会済みユーザー

2020/05/24 03:57

ご回答ありがとうございました。不要なパスの箇所自体もわからず困っておりますが、もう少し調べてみます、
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問