git
. If you receive an answer saying that the command is not found, you need to install.sudo service apache2 stop
php -v
you should get a message with the installed PHP version, make sure this is the same version as you see in the XAMPP dashboard. If not, you need to switch php-version in the terminal. There are different ways of doing that depending on your setup, look for how to do it in your environment.composer -V
you should get a message with the installed Composer versionplatform
database. The username and password can be anything; we will use ushahidi
for both in this example. Select the platform
database and execute the query below:plaform
database to this user by running the below command:C:\xampp
being the active foldercd htdocs
home/dev
.git clone https://github.com/ushahidi/platform.git platform
. This will download the Ushahidi Platform API code repository inside a folder named platform
.C:\xampp\htdocs\platform
platform
, inside your home folderpwd
.cd platform
copy .env.example .env
cp .env.example .env
.env
with your IDE or text editor. This file is located inside your platform folder.sudo nano .env
to open up the nano text-editor in the terminal. When you are finished editing, press ctrl-x and then Y when asked if you want to save..env
file may appear in your File Explorer window as a file with an empty name and of type "ENV file"CACHE_DRIVER
to be array
instead of memcache
(it's feasible set it up with memcache at some point, but for simplicity we use array
)DB_HOST
to 127.0.0.1
DB_USERNAME
to root
DB_PASSWORD
to be empty, so literally: DB_PASSWORD=
DB_DATABASE
to platform
DB_PORT
to the port you are using. Also, if you need to specify a certain socket for db connection, you can do it by adding DB_SOCKET
with the corresponding socket path.composer install
. Wait while composer installs all the dependenciescomposer migrate
to run the database migrations.admin
user with password administrator
composer
is not a known command, you can try the following setup in the command line:php composer.phar {command}
instead of composer {command}
in the two steps above. Such as:127.0.0.1 api.ushahidi.test
C:\Windows\System32\Drivers\etc\hosts
127.0.0.1 api.ushahidi.test
/etc/hosts
file in an editor with administrator privileges (i.e. with the terminal command sudo nano /etc/hosts
)127.0.0.1 api.ushahidi.test
httpdocs
, edit the file .htaccess
. Edit the contents of the file to match exactly these (you can open the file to edit through sudo nano .htaccess
):.htaccess
(as before, you can open the file to edit it through sudo nano .htaccess
). The contents should match these, again, exactly:"<your platform folder here>"
, you should change that for the full path of your platform folder, i.e. "C:\xampp\htdocs\platform"
in the case of Windows.ServerName ...
as needed.composer verify
command. This will run some quick checks and may give you useful insights.BACKEND_URL
. This is a variable that configures the client to send API requests to the right API backend.BACKEND_URL=http://api.ushahidi.test