Hey @jdm34 Thank you so much! I had some issues with setting it up but finally up and running now! Thanks again for this tutorial!
Fresh Install of MacOS High Sierra (13.1) with Laravel Valet, PHP, and Oracle (OCI8)
I documented the steps for my fresh install of High Sierra. Getting Oracle working can be a pain, hopefully this is helpful to someone.
Setting Up Laravel Development Environment On MacOS High Sierra (13.1) with Laravel Valet, PHP, and Oracle (OCI8)
Composer
Follow install instructions at https://getcomposer.org/download/
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
Follow install instructions at https://brew.sh/
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
- Type 1 and press return.
- Enter:
/usr/local/pear - Type 4 and press return.
- Enter:
/usr/local/bin - Press return
To verify PEAR, you should be able to type: pear version
Oracle InstantClient
From:
- 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 theses 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 installcommand. This will configure and install Valet and DnsMasq, and register Valet's daemon to launch when your system starts.
Fix NGINX 504 Gateway Time-out Error
Edit: /usr/local/etc/nginx/valet/valet.conf
Under server {, add
client_max_body_size 128M;
client_header_timeout 3000;
client_body_timeout 3000;
fastcgi_read_timeout 3000;
fastcgi_buffers 8 128k;
fastcgi_buffer_size 128k;
Restart with
valet stop
valet start
Hi @jdm34
I was trying to match my version of Oracle XE which is 10.2 and my pecl installation was not working properly, then I tried to use the latest 12.2 and it worked with 10.2 DB, that was the first issue.
Second was to actually test the connectiion, I use additional ssh tunell so I used sqlplus and tested the connection that way. This allowed me to tick those boxes and move on to another oci8 module. The trick is that valet restart does not work as expected and I had to do valet start/stop and also brew services php71 restart to actually enable oci8 extension
Finally when I was sure I have oci8 is running I added yajra/laravel-oci8.
That is it more less. I have to say that I wrote tutorial for myself and will probably appreciate it in few months ;-)
Thank you again for documenting the steps!
Please or to participate in this conversation.
