Skip to content

Instantly share code, notes, and snippets.

@jdm34
Last active August 23, 2022 11:46
Show Gist options
  • Save jdm34/6ddbf0575c81bb52465821167cb1f4aa to your computer and use it in GitHub Desktop.
Save jdm34/6ddbf0575c81bb52465821167cb1f4aa to your computer and use it in GitHub Desktop.
Setting Up Laravel Development Environment On Fresh Install Of MacOS High Sierra (13.1) with Laravel Valet, PHP, and Oracle (OCI8)

Setting Up Laravel Development Environment On Fresh Install of MacOS High Sierra (13.1) with Laravel Valet, PHP, and Oracle (OCI8)

Composer

https://getcomposer.org/download/

Open Terminal, copy, paste, and run

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');

Make composer available globally

mv composer.phar /usr/local/bin/composer

Make sure the ~/.composer/vendor/bin directory is in your system's "PATH".

nano ~/.bash_profile

Add export PATH="~/.composer/vendor/bin:$PATH"

Homebrew

https://brew.sh/

In Terminal

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

MySQL

brew install mariadb

brew services start mariadb

Login (enter blank password)

mysql -u root -p

Set Password

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');

Install Sequel Pro https://sequelpro.com and make sure you can connect:

Host: 127.0.0.1
Username: root
Password: MyNewPass

PHP 7.1

From https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions

brew tap homebrew/php

brew update

brew install php71

sudo chown -R `whoami`:admin /usr/local/share

brew link php71

Install PECL/PEAR

https://jason.pureconcepts.net/2012/10/install-pear-pecl-mac-os-x/

curl -O http://pear.php.net/go-pear.phar
sudo php -d detect_unicode=0 go-pear.phar
  1. Type 1 and press return.
  2. Enter: /usr/local/pear
  3. Type 4 and press return.
  4. Enter: /usr/local/bin
  5. Press return

To verify PEAR, you should be able to type: pear version

Oracle InstantClient

http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html https://gist.github.com/krisanalfa/09b765bb95012cd36fbd

Download:

  • instantclient-basic-macos.x64-12.2.0.1.0.zip
  • instantclient-sqlplus-macos.x64-12.2.0.1.0.zip
  • instantclient-sdk-macos.x64-12.2.0.1.0.zip

Create and unzip all these files into a the directory ~/lib

sudo ln -s ~/lib/sdk/include/*.h /usr/local/include/
sudo ln -s ~/lib/sqlplus /usr/local/bin/
sudo ln -s ~/lib/*.dylib /usr/local/lib/
sudo ln -s ~/lib/*.dylib.12.1 /usr/local/lib/
sudo ln -s /usr/local/lib/libclntsh.dylib.12.1 /usr/local/lib/libclntsh.dylib

Install autoconf

brew install autoconf

Install extention with pecl

sudo pecl install oci8

At the prompt enter: instantclient,/usr/local/lib

Add the following line to your php.ini /usr/local/etc/php/7.1/php.ini

extension=oci8.so

Run php -m to display loaded modules. Installation is successful if you see:

oci8

Laravel Valet

https://laravel.com/docs/5.5/valet

  • Install Valet with Composer via composer global require laravel/valet.
  • Run the valet install command. This will configure and install Valet and DnsMasq, and register Valet's daemon to launch when your system starts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment