https://wiki.apache.org/httpd/PHP-FPM
Steps
- libapache2-mod-fastcgi isn’t free software so include separate repo
add-apt-repository multiverse
apt-get update
https://wiki.apache.org/httpd/PHP-FPM
Steps
add-apt-repository multiverse
apt-get update
<?php | |
if (strstr($slug, '/')) { | |
$segments = explode('/', $slug); | |
$parent_id = null; | |
foreach ($segments as $key => $segment) { | |
$params['slug'] = $segment; | |
if ($parent_id) { |
LAMP server setup on Linode Ubuntu 14.04.1 LTS
Update system
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use App\Http\Requests; | |
use Carbon\Carbon; |
<Macro VHost $name $domain $db_host $db_name $db_user $db_pw> | |
<VirtualHost *:80> | |
# The ServerName directive sets the request scheme, hostname and port that | |
# the server uses to identify itself. This is used when creating | |
# redirection URLs. In the context of virtual hosts, the ServerName | |
# specifies what hostname must appear in the request's Host: header to | |
# match this virtual host. For the default virtual host (this file) this | |
# value is not decisive as it is used as a last resort host regardless. | |
# However, you must set it for any further virtual host explicitly. |
public function humanizeDateDifference($now,$otherDate=null,$offset=null) | |
{ | |
if($otherDate != null){ | |
$offset = $now - $otherDate; | |
} | |
if ($offset == 0) | |
{ | |
$otherDate =$otherDate + 1; | |
$offset = $now - $otherDate; | |
} |
/** | |
* Remove array key prefixes | |
* | |
*/ | |
function remove_prefix($array, $prefix) | |
{ | |
return array_combine( | |
array_map( | |
function($k,$prefix){ | |
return preg_replace("/^$prefix/", '', $k); |