I love the look of Twill and it seems like an incredible project, but I ran into some issues installing which have snowballed into none of my local Laravel apps working anymore.
Software |
Version |
macOS |
10.13.6 |
PHP |
7.2.8 |
MySQL |
8.0.12* |
Node |
10.4.0 |
* When I started all this it was 8.0.11.
I followed all the instructions in the Twill docs. Requiring and installing Twill went fine, running php artisan twill:setup
produced some errors but succeeded (I closed my tab before copying these logs so I don't know exactly what happened).
Then I ran yarn cms-build
and I feel like things went sideways. The log output from that was huge so I put it in a gist. It looks like it tried to reinstall Node? Could that have been because I used yarn
and not npm run
?
I opened my app up in a browser and was eventually able to find Twill's login page, but nothing else. Logging in at admin.blog.test/login
would redirect me to the Laravel welcome screen at blog.test
, admin.blog.test/users
would redirect me to /login
and then just reload the login page every time I tried to log in, and I couldn't make any other routes work.
Then I noticed that running any command that needed PHP (like php artisan migrate
or laravel new twill
) gave me this error:
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
After some googling I was able to resolve this with brew update && brew upgrade
, which did all this:
Updated 1 tap (homebrew/core).
==> Updated Formulae
quicktype
==> Upgrading 11 outdated packages, with result:
pyenv 1.2.5 -> 1.2.6, libpng 1.6.34 -> 1.6.35, node-build 3.0.12 -> 3.0.15, trash 0.8.5 -> 0.9.2, ruby-build 20180601 -> 20180618, php 7.2.6 -> 7.2.8, nginx 1.15.0 -> 1.15.2, freetds 1.00.91 -> 1.00.94, mysql 8.0.11 -> 8.0.12, imagemagick 7.0.8-5 -> 7.0.8-8, git 2.17.1 -> 2.18.0
==> Upgrading git
==> Downloading https://homebrew.bintray.com/bottles/git-2.18.0.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring git-2.18.0.high_sierra.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
zsh completions and functions have been installed to:
/usr/local/share/zsh/site-functions
Emacs Lisp files have been installed to:
/usr/local/share/emacs/site-lisp/git
==> Summary
🍺 /usr/local/Cellar/git/2.18.0: 1,488 files, 295.6MB
==> Upgrading libpng
==> Downloading https://homebrew.bintray.com/bottles/libpng-1.6.35.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libpng-1.6.35.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/libpng/1.6.35: 26 files, 1.2MB
==> Upgrading node-build
==> Downloading https://github.com/nodenv/node-build/archive/v3.0.15.tar.gz
==> Downloading from https://codeload.github.com/nodenv/node-build/tar.gz/v3.0.15
######################################################################## 100.0%
==> ./install.sh
🍺 /usr/local/Cellar/node-build/3.0.15: 493 files, 569.6KB, built in 4 seconds
==> Upgrading trash
==> Downloading https://homebrew.bintray.com/bottles/trash-0.9.2.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring trash-0.9.2.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/trash/0.9.2: 5 files, 40.6KB
==> Upgrading ruby-build
==> Downloading https://github.com/rbenv/ruby-build/archive/v20180618.tar.gz
==> Downloading from https://codeload.github.com/rbenv/ruby-build/tar.gz/v20180618
######################################################################## 100.0%
==> ./install.sh
🍺 /usr/local/Cellar/ruby-build/20180618: 405 files, 204.8KB, built in 4 seconds
==> Upgrading php
==> Installing dependencies for php: freetds
==> Installing php dependency: freetds
==> Downloading https://homebrew.bintray.com/bottles/freetds-1.00.94.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring freetds-1.00.94.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/freetds/1.00.94: 2,094 files, 11.9MB
==> Installing php
==> Downloading https://homebrew.bintray.com/bottles/php-7.2.8.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring php-7.2.8.high_sierra.bottle.tar.gz
==> /usr/local/Cellar/php/7.2.8/bin/pear config-set php_ini /usr/local/etc/php/7.2/php.ini system
==> /usr/local/Cellar/php/7.2.8/bin/pear config-set php_dir /usr/local/share/pear system
==> /usr/local/Cellar/php/7.2.8/bin/pear config-set doc_dir /usr/local/share/pear/doc system
==> /usr/local/Cellar/php/7.2.8/bin/pear config-set ext_dir /usr/local/lib/php/pecl/20170718 system
==> /usr/local/Cellar/php/7.2.8/bin/pear config-set bin_dir /usr/local/opt/php/bin system
==> /usr/local/Cellar/php/7.2.8/bin/pear config-set data_dir /usr/local/share/pear/data system
==> /usr/local/Cellar/php/7.2.8/bin/pear config-set cfg_dir /usr/local/share/pear/cfg system
==> /usr/local/Cellar/php/7.2.8/bin/pear config-set www_dir /usr/local/share/pear/htdocs system
==> /usr/local/Cellar/php/7.2.8/bin/pear config-set man_dir /usr/local/share/man system
==> /usr/local/Cellar/php/7.2.8/bin/pear config-set test_dir /usr/local/share/pear/test system
==> /usr/local/Cellar/php/7.2.8/bin/pear config-set php_bin /usr/local/opt/php/bin/php system
==> /usr/local/Cellar/php/7.2.8/bin/pear update-channels
==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php7_module /usr/local/opt/php/lib/httpd/modules/libphp7.so
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
Finally, check DirectoryIndex includes index.php
DirectoryIndex index.php index.html
The php.ini and php-fpm.ini file can be found in:
/usr/local/etc/php/7.2/
To have launchd start php now and restart at login:
brew services start php
Or, if you don't want/need a background service you can just run:
php-fpm
==> Summary
🍺 /usr/local/Cellar/php/7.2.8: 515 files, 79.1MB
==> Upgrading nginx
==> Downloading https://homebrew.bintray.com/bottles/nginx-1.15.2.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring nginx-1.15.2.high_sierra.bottle.tar.gz
==> Caveats
Docroot is: /usr/local/var/www
The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.
nginx will load all files in /usr/local/etc/nginx/servers/.
To have launchd start nginx now and restart at login:
brew services start nginx
Or, if you don't want/need a background service you can just run:
nginx
==> Summary
🍺 /usr/local/Cellar/nginx/1.15.2: 23 files, 1.4MB
==> Upgrading mysql
==> Downloading https://homebrew.bintray.com/bottles/mysql-8.0.12.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring mysql-8.0.12.high_sierra.bottle.tar.gz
==> Caveats
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
MySQL is configured to only allow connections from localhost by default
To connect run:
mysql -uroot
To have launchd start mysql now and restart at login:
brew services start mysql
Or, if you don't want/need a background service you can just run:
mysql.server start
==> Summary
🍺 /usr/local/Cellar/mysql/8.0.12: 255 files, 233.0MB
==> Upgrading imagemagick
==> Downloading https://homebrew.bintray.com/bottles/imagemagick-7.0.8-8.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring imagemagick-7.0.8-8.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/imagemagick/7.0.8-8: 1,516 files, 23.1MB
==> Upgrading pyenv
==> Downloading https://homebrew.bintray.com/bottles/pyenv-1.2.6.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring pyenv-1.2.6.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/pyenv/1.2.6: 607 files, 2.4MB
==> Caveats
==> git
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
zsh completions and functions have been installed to:
/usr/local/share/zsh/site-functions
Emacs Lisp files have been installed to:
/usr/local/share/emacs/site-lisp/git
==> php
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php7_module /usr/local/opt/php/lib/httpd/modules/libphp7.so
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
Finally, check DirectoryIndex includes index.php
DirectoryIndex index.php index.html
The php.ini and php-fpm.ini file can be found in:
/usr/local/etc/php/7.2/
To have launchd start php now and restart at login:
brew services start php
Or, if you don't want/need a background service you can just run:
php-fpm
==> nginx
Docroot is: /usr/local/var/www
The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.
nginx will load all files in /usr/local/etc/nginx/servers/.
To have launchd start nginx now and restart at login:
brew services start nginx
Or, if you don't want/need a background service you can just run:
nginx
==> mysql
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
MySQL is configured to only allow connections from localhost by default
To connect run:
mysql -uroot
To have launchd start mysql now and restart at login:
brew services start mysql
Or, if you don't want/need a background service you can just run:
mysql.server start
Now PHP worked again, so I made another new Laravel site, added Twill, and this time when I ran php artisan twill:setup
it only copied the migration files and then stopped, and then after a minute or two failed with this error:
PDOException : SQLSTATE[HY000] [2006] MySQL server has gone away
at /Users/jacob/Sites/twill/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68
64| if (class_exists(PDOConnection::class) && ! $this->isPersistentConnection($options)) {
65| return new PDOConnection($dsn, $username, $password, $options);
66| }
67|
> 68| return new PDO($dsn, $username, $password, $options);
69| }
70|
71| /**
72| * Determine if the connection is persistent.
Exception trace:
1 PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=twill", "admin", "admin", [])
/Users/jacob/Sites/twill/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68
2 Illuminate\Database\Connectors\Connector::createPdoConnection("mysql:host=127.0.0.1;port=3306;dbname=twill", "admin", "admin", [])
/Users/jacob/Sites/twill/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:98
Please use the argument -v to see more details.
My databases are still there and MySQL is running normally—the Laravel sites I had set up before are working, and I can see the data in MySQL with DataGrip and log in on the command line, but I can't do migrations. Regardless of which database and user I try, in my Twill test project or my other Laravel apps from before this or in a new one I made after trying everything else, trying to run php artisan migrate
tells me the MySQL server has gone away.
I restarted all my brew services a bunch of times, and reinstalled MySQL with homebrew, and still get the same error, even though apparently my apps can still connect to the DB because they're loading data when I visit them in a browser.
Any suggestions would be appreciated!! I can't really use Laravel now and that's a bit of a problem! I can't figure out what twill:setup
or yarn cms-build
could have done that would cause any of this.
Thanks!