+ Reply Thread
#1

I am going to be discussing some stuffs I faced as a php developer using MAC, I shall be restricted to commands mostly.


This allows you to switch from php 7.2.x to 5.6

$ brew unlink php@7.2 && brew link --force --overwrite php@5.6


Analyze this apache config:

LoadModule php5_module /usr/local/opt/php@5.6/lib/httpd/modules/libphp5.so #LoadModule php7_module /usr/local/opt/php@7.0/lib/httpd/modules/libphp7.so #LoadModule php7_module /usr/local/opt/php@7.1/lib/httpd/modules/libphp7.so #LoadModule php7_module /usr/local/opt/php@7.2/lib/httpd/modules/libphp7.so


And dont forget to run

$ sudo apachectl configtest

to ensure all is well before

$ sudo apachectl restart

#2

Setup php switcher:

$ curl -L https://gist.githubusercontent.com/rhukster/f4c04f1bf59e0b74e335ee5d186a98e2/raw > /usr/local/bin/sphp

$ chmod +x /usr/local/bin/sphp

$ sphp 5.6

$ sphp 7.0

$ sphp 7.1

$ sphp 7.2


To check the available stuffs:

$ brew list | grep php

php

php-cs-fixer

php56

php56-opcache

php56-xdebug

php71-apcu

php71-mcrypt

php71-opcache

php71-xdebug

php@5.6

php@7.0

php@7.1


To check the ini files
$ php --ini

Check the version of php
$ php -v

Check config path of apache
$ apachectl -V

#3
After messing up my ruby, I had to reset it up, and due to some issues I could not use homebrew, because brew is down at the moment:
And I had mac ports, so i had to:
$ rvm reinstall ruby-2.4.2
#4


$ pecl install xdebug


Back to top