Tip: if you are on #Laravel 5.5 and enjoy Carbon, be sure to use IlluminateSupportCarbon instead of CarbonCarbon. It's a wrapper class, 100% macroable, and allows you to set a custom json serializer. ? pic.twitter.com/mE8xbpYrAu
— Raul (@rcubitto) December 20, 2017
Mac Homebrew Dev Environment Stuff
Restart Apache
sudo apachectl restart
Apache Config
/usr/local/etc/apache2/2.4
.htaccess force SSL
[code]RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L][/code]
From inMotion Hosting
KEYBOARD LAYOUT
Left Alt + Shift to revert to correct keyboard layout.
I never remember this.
Shopify
https://twitter.com/noncototient/status/905629388758073344
Timber — opinionated, good for getting started
Dhopify — blank slate, more control & more advanced
Laravel New command not finding Composer
When calling ‘laravel new myapp’ this error is given:
sh: composer: command not found
Composer is aliased in ~/.bash_profile, which apparently doesn’t help the laravel installer find it (despite being in $PATH).
The solution was to copy /Users/me/composer.phar to /usr/local/bin/composer
The Laravel installer could then use Composer to setup the application.
Mac OS X / Homebrew Notes
which apachectl
/usr/local/bin/apachectl
I expect that response if the Homebrew version of Apache is running.
Restarting PHP FPM on Ubuntu 16.04
Probablyservice php7.3-fpm restart
Maybesystemctl restart php-fpm.service
Homebrew Locally
sudo brew services restart php74
MariaDB Password Change Not Working
New Ubuntu 16 server with MariaDB.
Tried using
“`SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘myGreatPassword’);
Password is changed but could not connect to DB from PHP.
Needed to update mysql.user table and set the Plugin field to an empty value (rather than unix_socket)!
LetsEncrypt SSL Failures
SSLs are failing to renew
- MySquash / UltraVulture due for renewal in <1 month
- Failing because Nginx is not allowing access to .well-known dir
- Need to debug syntax and rerun certbot-auto renew
Maybe related to SSL redirection. I think LetsEncrypts requests that file over http
Could HSTS interfere?
Update: One domain was failing due to out of date LetsEncrypt config (pointing to an old install folder).
Got it going by disabling force HTTPS redirect, creating .well-known/acme-challenge and rerunning.
Should be able to delete .well-known and leave it to LetsEncrypt to create those.
Update2:
/etc/letsencrypt/renewal/www.mysquash.pro.conf referred to old install directory (I bump directory when upgrading Laravel).
So .well-known would have been created in wrong path. Pointed to mysquash54, but cannot test yet as now there have been too many recent fails of the domain 🙁
I may have passed through the correct nginx config along the way and not known it.