Tag: MacPorts/php7
sudo port uninstall php71*
$ sudo port install php74-apache2handler php74-mysql php74-mbstring php74-gd php74-openssl php74-curl
/opt/local/var/db/php74/gd.ini, /opt/local/var/db/php74/mbstring.ini, /opt/local/var/db/php74/mysql.ini
---> Some of the ports you installed have notes: libpsl has the following notes: libpsl API documentation is provided by the port 'libpsl-docs'. mysql8 has the following notes: On activation if no /opt/local/etc/mysql8/my.cnf file exists one will be created which loads /opt/local/etc/mysql8/macports-default.cnf. If a /opt/local/etc/mysql8/my.cnf file exists MacPorts does not touch it and any changes you make to /opt/local/etc/mysql8/my.cnf will be preserved (e.g., during port upgrades, deactivations or activations). /opt/local/etc/mysql8/my.cnf is a good place to customize your mysql8 installation. Any changes made to /opt/local/etc/mysql8/macports-default.cnf will be lost during port upgrades, deactivations or activations so you are advised to not make changes here. Currently /opt/local/etc/mysql8/macports-default.cnf contains only one directive; to disable networking. With disabled networking it is possible to install and have running all the MacPorts mysql ports simultaneously. To set mysql8 as your preferred version of MySQL, use `port select`, as follows: $ sudo port select mysql mysql8 php74 has the following notes: To customize php74, copy /opt/local/etc/php74/php.ini-development (if this is a development server) or /opt/local/etc/php74/php.ini-production (if this is a production server) to /opt/local/etc/php74/php.ini and then make changes. php74-apache2handler has the following notes: If this is your first install, you need to enable php74-apache2handler in your web server. To enable php74-apache2handler, run: cd /opt/local/lib/apache2/modules sudo /opt/local/bin/apxs -a -e -n php7 mod_php74.so php74-mysql has the following notes: To use mysqlnd with a local MySQL server, edit /opt/local/etc/php74/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_php74.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 = Off 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
/opt/local/var/run/mysql8/mysqld.sock