4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MAMP Virtual hosts/OPcache 設定

Last updated at Posted at 2014-04-17

MAMP Downloads

MAMP & MAMP PRO - Downloads: (https://www.mamp.info/en/downloads/)

※既にMAMPをインストールしている場合

/Applications/MAMP/conf/apache/httpd.conf をデスクトップなどに保存してから
新しいMAMPをインストールしましょう。
今までの設定が全て消えてしまいます。

Virtual hostsを許可する

ターミナルで下記ファイルを開きます。

$ vim /Applications/MAMP/conf/apache/httpd.conf

変更前

httpd.conf
# Virtual hosts
#Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

変更後

httpd.conf
# Virtual hosts
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

Virtual hostsを設定する

※既にMAMPをインストールしていた方は、先ほどデスクトップに保存した
httpd-vhosts.conf で上書きしましょう。

$ vim /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
httpd-vhosts.conf
Listen 8080
<VirtualHost *:8080>
DocumentRoot "/Users/macbookpro/htdocs"
ServerName localhost
<Directory "/Users/macbookpro/htdocs">
Options Indexes FollowSymLinks +Includes
AddOutputFilter INCLUDES .html .php
AddHandler application/x-httpd-php .html .php .cgi
AllowOverride All
Order Allow,Deny
Allow From All
</Directory>
</VirtualHost>

PHP 5.5/OPcache を無効にする

$ vim /Applications/MAMP/bin/php/php5.5.10/conf/php.ini 

変更前

php.ini
[OPcache]
;zend_extension="/Applications/MAMP/bin/php/php5.5.10/lib/php/extensions/no-debug-non-zts-20121212/opcache.so"
  opcache.memory_consumption=128
  opcache.interned_strings_buffer=8
  opcache.max_accelerated_files=4000
  opcache.revalidate_freq=60
  opcache.fast_shutdown=1
  opcache.enable_cli=1

変更後

php.ini
;zend_extension="/Applications/MAMP/bin/php/php5.5.10/lib/php/extensions/no-debug-non-zts-20121212/opcache.so"
  opcache.memory_consumption=128
  opcache.interned_strings_buffer=8
  opcache.max_accelerated_files=4000
  opcache.revalidate_freq=60
  opcache.fast_shutdown=1
  opcache.enable_cli=0
  opcache.enable=0
4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?