Tag: MacPorts/php7
sudo port uninstall php71*
$ sudo port install php72-apache2handler php72-mysql php72-mbstring php72-gd
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
cd /opt/local/lib/apache2/modules sudo /opt/local/bin/apxs -a -e -n php7 mod_php72.so
$ cd /opt/local/etc/apache2 $ vi httpd.conf
<IfModule dir_module> DirectoryIndex index.html index.php </IfModule>
AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
$ cd /opt/local/etc/php72 $ sudo cp php.ini-development php.ini $ sudo vi php.ini
[mbstring] mbstring.language = Japanese mbstring.internal_encoding = UTF-8 mbstring.http_input = auto mbstring.http_output = UTF-8 mbstring.encoding_translation = On mbstring.detect_order = auto mbstring.substitute_character = none; mbstring.func_overload = 0
[Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone date.timezone = "Asia/Tokyo"
$ sudo /opt/local/sbin/apachectl restart
/opt/local/var/run/mysql55/mysqld.sock