Skip to content

Instantly share code, notes, and snippets.

@whoacowboy
Last active April 4, 2018 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whoacowboy/458c8a1b1288edc7bd234b75b9bbf591 to your computer and use it in GitHub Desktop.
Save whoacowboy/458c8a1b1288edc7bd234b75b9bbf591 to your computer and use it in GitHub Desktop.
Uninstall XAMPP - Install Valet - Install TemaTres

Uninstall XAMPP

How to uninstall XAMPP on Mac OS X?

Installation (Mac OS X)

Run these commands in terminal (every line with a # in front of it is a comment)

Uninstall Apache

sudo apachectl -k stop
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

Install XCode command line tools

xcode-select --install

Install Brew

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

Install PHP

brew update
brew doctor
brew install homebrew/core/php
 
# Launch at startup
sudo cp /usr/local/opt/php71/homebrew.mxcl.php71.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php71.plist

Install MariaDB (an open source version of mysql)

brew install mariadb
 
# Launch at startup
sudo cp /usr/local/opt/mariadb/homebrew.mxcl.mariadb.plist ~/Library/LaunchAgents/ 
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist

Create database

mysql -uroot;

CREATE DATABASE tematres;

CREATE USER 'develop'@'localhost';
SET PASSWORD FOR 'develop'@'localhost' = PASSWORD('secret');
CREATE USER 'develop'@'%';
GRANT ALL PRIVILEGES ON tematres.* TO 'develop'@'localhost' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON tematres.* TO 'develop'@'%' WITH GRANT OPTION;
exit;

Install Composer

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

# If you want to verify the executable's hash you need to get this next line from their [instructions](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx).
# php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
# hash will change

sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
php -r "unlink('composer-setup.php');"
sudo chown -R $USER .composer/
echo 'export PATH=~/.composer/vendor/bin:$PATH' >> ~/.bash_profile
. ~/.bash_profile

Install Valet

composer global require laravel/valet

valet install
valet restart

Install TemaTres

Run these commands in terminal

Make your base directory

mkdir -p ~/Code
cd ~/Code

Clone the repo into your repo

git clone https://github.com/tematres/TemaTres-Vocabulary-Server.git tematres
cd tematres

Edit your TemaTres database config file

bbedit ./vocab/db.tematres.php

# or

pico ./vocab/db.tematres.php

# or edit this file with your favorite text editor

Make it look like this

<?php
/*
 *      db.tematres.php
 *
 *      Copyright 2011 diego ferreyra <diego@r020.com.ar>
 *
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
// Configuarcion de base de datos - Database Configuration
// Select driver to use
// Default: MySQLi , can be mysqli,postgres, oci8, mssql, and more: http://phplens.com/adodb/supported.databases.html
// To default value, leave empty eg: $DBCFG["DBdriver"] ="";
$DBCFG["DBdriver"] ="mysqli";

//  Dirección IP o nombre del servidor - IP Address of the database server
$DBCFG["Server"]      = "localhost";

//  Nombre de la base de datos Database name
$DBCFG["DBName"]     = "tematres";

//  Nombre de usuario - login
$DBCFG["DBLogin"]    = "develop";

//  Passwords
$DBCFG["DBPass"] = "secret";

//  Prefijo para tablas # Prefix for tables
$DBCFG["DBprefix"] = "lc_";


$DBCFG["DBcharset"] ="utf8";

//  modo debug = 1 // debug mode = 1
$DBCFG["debugMode"] = "0";

// Define if storage hashed passwords or not  (1 = Yes, 0 = No: default: 0)
define('CFG_HASH_PASS','0');

/*  In almost cases, you don't need to touch nothing here!!
 *  Absolute path to the directory where are located /common/include.
 */

// change to whatever timezone you want
if(date_default_timezone_get()!=ini_get('date.timezone')){
	date_default_timezone_set('Etc/UTC');
}

if ( !defined('T3_ABSPATH') )
	/** Use this for version of PHP < 5.3 */
	define('T3_ABSPATH', dirname(__FILE__) . '/../');

	/** Use this for version of PHP >= 5.3	*/
	//~ define('T3_ABSPATH', dirname(__DIR__) . '/');

	/** Use to define specific local path for common/include directory */
	//~ define('T3_ABSPATH', '/home/my_name/tematres/');
?>

Start Valet

valet start
valet link

Follow the TemaTres installation process

Navigate to http://tematres.test or https://tematres.test

I'm not sure which prefix valet uses by default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment