Skip to content

Instantly share code, notes, and snippets.

@pgee70
Created August 23, 2018 23:38
Show Gist options
  • Save pgee70/ba6238c01dfe1a8b11ef578f2b5dc4ff to your computer and use it in GitHub Desktop.
Save pgee70/ba6238c01dfe1a8b11ef578f2b5dc4ff to your computer and use it in GitHub Desktop.
update mac ports php installation
#updating php versions is a hassle, these steps help make it less so...
sudo port uninstall php7*
sudo port selfupdate
sudo port install php72 php72-apache2handler php72-calendar php72-cgi php72-curl php72-exif php72-fpm php72-ftp php72-gd php72-geoip php72-gettext php72-gmagick php72-iconv php72-imagick php72-imap php72-intl php72-ipc php72-ldap php72-lzf php72-mailparse php72-mbstring php72-mcrypt php72-mysql php72-openssl php72-pdflib php72-xdebug php72-zip php_select
cd /opt/local/lib/apache2/modules/
sudo /opt/local/bin/apxs -a -e -n php7 mod_php72.so
sudo port select php php72
cd /opt/local/etc/php72/
sudo cp php.ini-development php.ini
#update as required filemerge util is handy to see what has changed. needed to set up mysqli default sockets etc.
sudo nano /opt/local/etc/apache2/httpd.conf
#make sure that all but the last php.so is enabled.
LoadModule php7_module lib/apache2/modules/mod_php72.so
sudo port unload apache2
sudo port load apache2
# restart apache
#!/bin/bash
SYNTAX=`/opt/local/sbin/apachectl -t -t 2>&1`
if [ "$SYNTAX" = 'Syntax OK' ]; then
sudo port unload apache2
sudo port load apache2
echo 'Restarted Apache'
else
sudo apachectl -t
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment