1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-06 00:40:06 +01:00
Commit Graph

56 Commits

Author SHA1 Message Date
Chris Brown
dd17bb9e9a Force removal of orphaned valet.sock file
When switching PHP versions the valet.sock file may not be removed if the linked PHP process doesn't get shut down properly. This can happen when Homebrew switches default `php` version aliases and if one has started multiple homebrew PHP instances under different permission levels or different users.

This patch merely forces the .sock file's removal when switching versions. 

In very rare cases a filesystem lock may prevent the file's proper removal, in which case a reboot might be required.

To prevent these issues, keep Homebrew up-to-date by running `brew upgrade` on a regular basis (weekly is good).
2021-01-21 11:33:47 -05:00
Chris Brown
98e7a02a3c Add shivammathur/php tap for supporting unofficial PHP releases 2020-11-28 23:49:03 -05:00
Chris Brown
a03e2e09ce Improvements to "valet use" command
- properly detects if the requested version is already installed, and skips re-installing/re-starting/re-configuring
- allows --force to re-configure anyway
- smarter treatment of 'php' when it's aliased to another specific installed version
2020-11-28 23:38:30 -05:00
Chris Brown
be63541dd8 Normalize PHP version parsing 2020-11-28 23:17:21 -05:00
Chris Brown
ce0999f8cd Point PHP-FPM error_log to user directory
Old: `/usr/local/var/log/php-fpm.log`
New: `~/.config/valet/Log/php-fpm.log`

(We already put `~/.config/valet/Log/nginx-error.log` there)

This avoids ARM Mac differences in directory paths.
2020-11-23 09:21:55 -05:00
soilSpoon
2c06a5d4f0 Modify the paths of packages to be based on brew prefix
- brew
- dnsmasq
- nginx
- php-fpm
- log
- etc
2020-11-15 14:38:18 +09:00
Chris Brown
116c7a7b8c Detect running php when no version constraint specified with use command
Fixes #756

Previously if `php` was installed as just `php` (the default Homebrew alias), Valet would not detect *which* PHP version was actually installed, and therefore `valet use` might do incorrect or unnecessary installations/links/etc.

NOTE: This does NOT "convert" existing `php` alias to a numbered version. It merely accepts it as-is, but notes its version in an attempt to avoid extra installations.

*NOTE: Specifally tested with PHP 7.4 and 7.3. No promises about old 5.6, etc aliases.*
2020-01-04 13:36:20 -05:00
Chris Brown
6e01bfb5f4 Allow Valet to uninstall itself
`valet uninstall` only displays information about how to manually uninstall and clean up after Valet.

This PR adds a `--force` parameter, which will forcefully remove Valet and the Homebrew services it installs, as well as clean up the config files and log files.
But for a few post-uninstall composer dependencies, cleanup is very thorough.

This brings idempotency to both `valet install` and `valet uninstall --force`

(There may still be edge cases where other Homebrew or composer packages might create interference with install/uninstall, but this makes things much easier to self-troubleshoot.)
2019-12-05 22:19:55 -05:00
Chris Brown
139a916013 Move PHP-FPM config to separate valet-specific file
This allows the valet configuration to stand separately from the default PHP config.
This benefits troubleshooting, makes customization of FPM workers and other settings easer
and allows for easier uninstallation.

Also renames any previously-existing `www.conf` pool config so it doesn't conflict with Valet nor run unnecessary additional processes.
2019-12-05 15:01:11 -05:00
Matt Allan
76a0c3222e Fix incorrect comments 2019-08-07 11:11:51 -04:00
James Barnard
290c22a1f7 added suggested 7.2 and fix doesn't typo 2019-01-28 20:26:13 -05:00
James Barnard
0bf3078220 update to unlink not the current version but the currently linked formula path (handles bug with latest version under php path) 2019-01-28 20:26:13 -05:00
James Barnard
ece3a1ff2f clean up to remove search, refactor to better handle versions using regex 2019-01-28 20:26:13 -05:00
James Barnard
6a5c06e934 add tests for use version and return the found version to output 2019-01-28 20:26:13 -05:00
James Barnard
6158e5129b add more tests for new methods and bits of clean up 2019-01-28 20:26:13 -05:00
James Barnard
25c4fab2b4 stop running php and search brew for php to verify can install it before trying the wrong formula, todos for tests 2019-01-28 20:26:13 -05:00
James Barnard
28748baa80 working on php version and tests 2019-01-28 20:26:13 -05:00
Chris Brown
7dd06db2b0 Change default PHP install pkg to 'php'
When no homebrew-installed PHP version is found, Valet attempts to install one.
The old default was `php71`. This PR changes it to `php`, which will install the latest Homebrew PHP version.
The problem with installing an older version is that Homebrew no longer symlinks it automatically. Rewriting Valet to do the symlinking is a little more involved since we should check for "which" version to link, vs other versions installed, etc.
Simply changing the default to the primary supported PHP version allows Valet to rely on Homebrew symlinking it properly.
2019-01-07 21:41:35 -05:00
Rob Stanley
f86f0968f3 Update the tap list, current taps deprecated.
> valet install
Stopping nginx...
Installing nginx configuration...
Installing nginx directory...
Installing php71...
Error: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated.
Error: homebrew/versions was deprecated. This tap is now empty as all its formulae were migrated.
Error: homebrew/php was deprecated. This tap is now empty as all its formulae were migrated.
2018-05-22 14:12:54 +01:00
Jesus Urrutia
0da2c6fc0e Fix return string with php-fpm config path for linked PHP 2018-04-09 16:17:57 -03:00
Adam Wathan
64cc7448b1 Refactor loop to map 2018-04-09 14:33:40 -04:00
Jesus Urrutia
b52ae454a2 Maintain compatibility with the old name of the PHP version 2018-04-09 11:20:19 -03:00
Jesus Urrutia
1dd83f133b Unify php versions list. Fix deprecated homebrew/php 2018-04-06 18:52:46 -03:00
Taylor Otwell
5d74ad18cb Revert "fix for new php versions/paths from php installed via brew" (#551)
* Revert "wip"

This reverts commit 15c961e41e.

* Revert "fix changes where brew php paths now include @ and semver-style versions in paths (#545)"

This reverts commit 7f61475feb.
2018-04-03 11:38:18 -07:00
James Doyle
7f61475feb fix changes where brew php paths now include @ and semver-style versions in paths (#545) 2018-04-03 07:06:10 -07:00
Taylor Otwell
884753b75e fixes 2018-03-02 08:25:57 -06:00
Korvin Szanto
b6d40c5f8c Update PhpFpm.php 2017-06-19 14:32:45 -07:00
Adam Wathan
ba0a3ba4e7 Merge pull request #263 from antonioribeiro/showStartStopInfo
Show start & stop process info in terminal
2017-03-23 10:45:26 -04:00
Adam Wathan
1f4dd70740 Capitalize PHP 2017-03-23 09:01:10 -04:00
Adam Wathan
767d29d359 Fix issue when conf.d folder doesn't exist 2017-03-06 12:28:40 -05:00
Antonio Carlos Ribeiro
6f8c14271a Show install, start, stop and restart log info 2017-02-21 12:04:45 -03:00
Kennedy Tedesco
d8c137876f Dry's up PHP installation
Ref: https://github.com/laravel/valet/pull/261
2017-02-20 13:48:59 -03:00
Adam Wathan
a249072310 Merge pull request #277 from drbyte/fix-413-request-entity-too-large-and-uploads
Fix large-upload problems by setting PHP limits and Nginx max size
2017-02-20 09:25:12 -05:00
Adam Wathan
3027a0dbba Explicitly stop and start brew services instead of restart
This solves a mysterious issue that may or may not be specific to my
machine and it makes me very sad.
2017-01-21 12:00:05 -05:00
Chris Brown
e208ca2340 Update minimum PHP requirement to 5.6
... because it's not actually compatible with 5.5 anymore - Ref: https://github.com/laravel/valet/issues/279
2016-12-27 15:58:16 -05:00
Chris Brown
bb59e1da2d Fix large-upload problems by setting PHP limits and Nginx max size
- Sets `client_max_body_size 128M` in `http` section of `nginx.conf`  so it covers all configs
- Adds `php-memory-limits.conf` to `php-fpm` conf folder, to set `memory_limit`, `upload_max_filesize`, `post_max_size` all to 128M

(Updates #253 by moving config location to cover all, since #253 didn't cover secure configs, etc)
2016-12-24 15:43:11 -05:00
Daniel Polito
5a25224e11 Upgrading PHP to 7.1 (#227) 2016-12-14 14:14:33 -06:00
Taylor Otwell
a501ebcd5b fix broken change 2016-12-09 09:20:28 -06:00
Taylor Otwell
fba8eb7602 fix nginx support 2016-12-08 08:32:55 -05:00
Adam Wathan
4c86e351a2 Use socket, store in valet home and set loose permissions 2016-12-08 08:32:54 -05:00
Adam Wathan
2ac1711eef Listen on port instead of socket 2016-12-08 08:32:54 -05:00
Adam Wathan
0da0fb3b1b Grueing around 2016-12-08 08:32:54 -05:00
Adam Wathan
733747900e Revert to using port instead of socket to see if it helps stale page issue 2016-10-22 11:35:07 -04:00
Adam Wathan
802cfb0525 Remove dead code 2016-09-28 17:10:49 -04:00
Adam Wathan
3facbef790 Disable default_mimetype with ini_set instead of via config file 2016-09-28 16:58:13 -04:00
Adam Wathan
1c29674d7b Use a separate .ini file instead of editing the main php.ini file 2016-09-28 16:58:13 -04:00
Adam Wathan
73a205aa81 Serve static files through Caddy instead of PHP 2016-09-28 16:58:13 -04:00
Michael Gruschwitz
5da6c5a095 Move php-fpm socket
Subdirectories in /var/run are deleted on reboot. That causes php-fpm to fail after reboot, because the socket in /var/run/valet can't be created, since the subdirecotry does not exist. The php-fpm socket should be moved directly to /var/run.
2016-09-28 10:56:21 +02:00
Taylor Otwell
372775a4fa remove superstition 2016-09-21 09:16:07 -05:00
Korvin Szanto
909ba9bd12 Use sockets instead of port 9000 2016-09-19 19:27:45 -07:00