#author("2019-02-07T22:31:57+09:00","default:wikiwriter","wikiwriter") &tag(MacPorts/php7); *目次 [#lfdfa383] #contents *関連ページ [#s19c1cae] -[[../php5]] *参考情報 [#sab2eba0] *インストール&apache2に設定 [#d788cf07] **必要なportのインストール [#le8f61dd] -apache2用から使用するモジュール、mysql、mbstringモジュールをインストール。 $ sudo port install php72-apache2handler php72-mysql php72-mbstring -以下のような情報が表示される。 #pre{{ php72 has the following notes: To customize php72, copy /opt/local/etc/php72/php.ini-development (if this is a development server) or /opt/local/etc/php72/php.ini-production (if this is a production server) to /opt/local/etc/php72/php.ini and then make changes. php72-apache2handler has the following notes: If this is your first install, you need to enable php72-apache2handler in your web server. To enable php72-apache2handler, run: cd /opt/local/lib/apache2/modules sudo /opt/local/bin/apxs -a -e -n php7 mod_php72.so php72-mysql has the following notes: To use mysqlnd with a local MySQL server, edit /opt/local/etc/php72/php.ini and set mysql.default_socket, mysqli.default_socket and pdo_mysql.default_socket to the path to your MySQL server's socket file. For mysql5, use /opt/local/var/run/mysql5/mysqld.sock For mysql51, use /opt/local/var/run/mysql51/mysqld.sock For mysql55, use /opt/local/var/run/mysql55/mysqld.sock For mysql56, use /opt/local/var/run/mysql56/mysqld.sock For mariadb, use /opt/local/var/run/mariadb/mysqld.sock For percona, use /opt/local/var/run/percona/mysqld.sock }} -とりあえずapache2のモジュールを組み込む。 #pre{{ cd /opt/local/lib/apache2/modules sudo /opt/local/bin/apxs -a -e -n php7 mod_php72.so }} **httpd.confの基本設定 [#vf0e4351] -httpd.confの編集 --httpd.confを開く #pre{{ $ cd /opt/local/etc/apache2 $ vi httpd.conf }} --dir_moduleの変更 #pre{{ <IfModule dir_module> DirectoryIndex index.html index.php </IfModule> }} -mime_moduleの最後に追加 #pre{{ AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps }}