Dec 7, 2015
This is how I got PHP 7 and APCu running on one of the entry-level Digital Ocean droplets:
PHP 7
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php-7.0
apt-get update && apt-get purge php5-fpm && apt-get --purge autoremove && apt-get install php7.0-fpm php7.0-mysql php7.0-gd php7.0-dev
If you need additional php7.0 packages, check the list:
sudo apt-cache search php7
In my enabled nginx site configs (I'm sure there's a place to put this globally, but I only had a couple of sites, so I didn't bother researching that for now):
Replace:
fastcgi_pass unix:/var/run/php5-fpm.sock;
With:
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
APCu
git clone https://github.com/krakjoe/apcu
Follow the instructions for building APCu in the INSTALL file
In addition to the updates to php.ini described in the INSTALL file, update the 'extensions_dir' directive:
extension_dir = "
/usr/lib/php/20151012/"
Do the same for both the FPM and CLI versions of php.ini
Restart PHP-FPM and Nginx:
sudo service php7.0-fpm restart
sudo service nginx restart
That did it for me. With APCu installed, I can continue to use APC as the driver for session and cache in my Laravel 5 apps when Memcache, Redis, etc. are overkill.
Jan 9, 2015
So I run an "extras" script after installing Laravel's Homestead that installs LDAP, Oracle Drivers, and Oh-My-Zsh among other things. But afterwards, I cannot run the "serve" command in the homestead VM to add new Nginx sites. I've finally figured out that the serve command is actually a bash shell alias function thingy inside .bash_aliases, so it's being ignored once I switch to Oh-My-Zsh.
Simply copying the serve function to .zshrc doesn't work due to some apparent syntax differences with bash and zsh. After digging around a bit, I've slightly modified the function to work now with zsh inside .zshrc:
Hopefully this helps someone else, or maybe someone has a better solution altogether.
Jun 20, 2014
Having a single Vagrant VM for all of my projects is nice, but I was used to controlling Vagrant from within a project's folder in Terminal and not having to go back to the central Homestead folder to run things like vagrant up
or vagrant reload
.
Adding these to my Oh-My-Zsh config (.zshrc) seems to do the trick:
alias devup="cd '/Users/gtaylor/Sites/Work/Homestead' && vagrant up && cd - 1> /dev/null"
alias devreload="cd '/Users/gtaylor/Sites/Work/Homestead' && vagrant reload && cd - 1> /dev/null"
alias devdown="cd '/Users/gtaylor/Sites/Work/Homestead' && vagrant halt && cd - 1> /dev/null"
I'm using these in conjunction with `alias dev='ssh [email protected] -p 2222'` from the Homestead documentation.
Jun 18, 2014
I put off moving my existing vagrant dev VMs over to [Laravel's Homestead](http://laravel.com/docs/homestead) for a couple of reasons:
- It doesn't completely match my production environments (Ubuntu 14.04 instead 12.04, PHP 5.5 instead of 5.4, Nginx instead of Apache).
- I knew I'd need to customize the VM anyway and I already had that worked out with my existing VMs (note the plural).
Mar 13, 2014
Depending on usage, errors, and what you’ve chosen to log, the Laravel application log(s) can really grow after a while. With Laravel 3 and initially with Laravel 4, new log files were created every day by default, which kept them small and easy to search, but now Laravel 4 defaults to a single log file (which I prefer). Logrotate is a common utility on linux servers to handle the backup and rotation of server logs (Apache, syslogs, etc.) and it’s really simple to add additional logs/folders for Logrotate to handle. There’s a nice Digital Ocean tutorial for using Logrotate on Ubuntu 12.10, but here’s a quick and easy run through on how to use Logrotate with your Laravel logs: