
#######################################################
Upgrading php on tinkertools.org for use with Wordpress
#######################################################

Upgraded php from 7.2.21 to 7.3.8 in February 2020. This was done by running
the command "curl -s https://php-osx.liip.ch/install.sh | bash -s 7.3" in a
terminal window. See the installation instructions available at the sites:

https://php-osx.liip.ch  (main site, now deprecated)
https://github.com/liip/php-osx/issues/174  (info on use with macOS Server)
https://coolestguidesontheplanet.com/upgrade-php-on-osx

The installation will appear in /usr/local, and /usr/local/php5 should be
linked to the Liip installation directory, also found under /usr/local. A
backup of the full php 7.3.8 install to be expanded under /usr/local can be
found under this directory as /php-liip/php5-7.3.8-20190811-205217.tar.gz.

Note that this upgrade mechanism is now deprecated, and the developers at
liip.ch do not intend to support installation of php beyond 7.3.8.

Note that when running macOS server, there is a different Apache install
that is used to provide the web server. It is located in the directory
/Library/Server/Web instead of in /etc/apache2. Configuration for the
server version of apache2 requires editing the httpd config file at
/Library/Server/Web/Config/apache2/httpd_server_app.conf to comment any
LoadModule line for php5_module, and add the LoadModule and code below:

LoadModule php7_module /usr/local/php5/libphp7.so

<IfModule php7_module>
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
    <IfModule dir_module>
        DirectoryIndex index.html index.phpdi
    </IfModule>
</IfModule>

A working httpd config file can be found under this directory as the file
php-liip/httpd_server_app.conf.

In addition, create a "php.ini" link in /Library/Server/Web/Config/php to
point to /usr/local/php5/lib/php.ini, which is the Liip php.ini file.

The switch to 7.3.8 caused JIT compilation/out of memory errors when trying
to access the wp-admin page. This was fixed by adding a single line with
the command "php_value pcre.jit 0"  to the bottom of the .htaccess file in
/user/www-tinker. See https://wordpress.stackexchange.com/questions/326345/ \
wordpress-warning-preg-replace-jit-compilation-failed-no-more-memory.

