Skip to content

Instantly share code, notes, and snippets.

@erikaheidi
Last active September 16, 2015 19:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikaheidi/c998d17774683ac67e2c to your computer and use it in GitHub Desktop.
Save erikaheidi/c998d17774683ac67e2c to your computer and use it in GitHub Desktop.
Mentorship Resources

September 14, 2015 Meeting

##About Networks, connections and relationships

##PHPWomen

##Learning PHP

##Composer Composer is the de-facto dependency / package manager for PHP.

##Running PHP on Ubuntu For Ubuntu 14.04

$ sudo apt-get update
$ sudo apt-get install php5-cli

For older Ubuntu versions (add a PPA to get most recent version of PHP)

$ sudo add-apt-repository ppa:ondrej/php5-oldstable
$ sudo apt-get update
$ sudo apt-get install php5-cli

To run the built-in web server:

$ php -S localhost:8000

This will start a web server using the current folder as document root. If you have a index.php file you just need point your browser to http://localhost:8000 and you should be able to access it :) any other php script in this folder can be accessed as http://localhost:8000/file.php

Homework

User Composer to install the package guzzle/guzzle. You will find the instructions to use this package on the project's README page. Try to create a simple page that gets a content from an external source and prints it on screen.

If you have time to go a bit further, you might play a bit with an open API that doesn't require authentication, like the eet.nu! Try something to fetch the results from https://api.eet.nu/venues?query=vegetarian for instance. This function will help you convert the result to array: json_decode.

Happy Coding!

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