Tag: MacPorts/php7
$ sudo port install php72-apache2handler php72-mysql php72-mbstring
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