Coder Social home page Coder Social logo

valet's People

Contributors

aaemnnosttv avatar adamwathan avatar adrum avatar antonioribeiro avatar aryehraber avatar drbyte avatar driesvints avatar eberkund avatar fschwaiger avatar furey avatar gounlaf avatar grusch-it avatar jasonvarga avatar jerguslejko avatar jesusgoku avatar jrbarnard avatar kennedytedesco avatar korvinszanto avatar kroko avatar lasserafn avatar lucasmichot avatar m1guelpf avatar mattstauffer avatar mcaskill avatar mikaelpopowicz avatar nasirnobin avatar opjepl44tsm4n avatar simensen avatar stylecibot avatar taylorotwell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

valet's Issues

Incorrect version number

I just updated composer globally, saw valet 1.1.17 package update. I reinstall valet, and upon running valet -V it returns version 1.1.16 instead of 1.1.17.

screen shot 2016-08-14 at 9 51 17 am

Automate process of swapping underlying PHP using brew

Coming from #178, I switch my php versions out when I need to really easily by doing this:

$ brew unlink php70
$ brew link php56
$ valet install
$ valet restart

We already have a brew class, is it possible to do this kind of thing as part of valet? Something like valet use php70 would be great.

WordPress 4.6 - Fatal Error: Uncaught phpmailerException

The latest version of Wordpress (4.6) and Valet causes a fatal error on step 2 of installing wordpress. The error is "Fatal error: Uncaught phpmailerException: Invalid address: wordpress@....".

This error occurs because WP expects the $_SERVER['SERVER_NAME'] to be set in order to create the $from_email variable. See wp-includes/pluggable.php ~line 326.

By default, Valet does not set the $_SERVER['SERVER_NAME']. Run phpinfo() and you will see no value.

To fix this issue:

In ~/.composer/vendor/laravel/valet/clu/drivers/WordPressValetDriver.php, within the frontControllerPath, add the following:

$_SERVER['SERVER_NAME'] = $siteName.'.dev'

That's assuming you are using the .dev TLD. If not, change it to whatever you are using.

Run valet restart.

Strange encoding issues

After upgrading to Laravel Valet I now have strange encoding issues on my application. This didn't happen when running homestead.

Example:

image

500 Internel Server Error Message

I've noticed that when I'm using laravel with valet, sometime I get a 500 Internal server error messages on all pages.
Everything works fine but "500 Internal Server Error" show up on all pages, sometimes in bottom of pages or sometimes on the top, but when I restart Valet using Valet restart the message disappears, maybe I'm not only one with this issue, or maybe this could help someone, or and I hope this issue will be fixed.

I'm using MacOS Sierra Version 10.12 Beta (16A313a) for the record

Accessing Valet from within a VirtualBox

Hi!

I'm in a situation that requires me to test our website on Internet Explorer / Edge intensively. I'm on Mac which of course makes it a bit difficult to debug IE/Edge.

The solution I have found so far was to install WIndows 10 in a VirtualBox and debug from there. I can access the host localhost by the IP 10.0.2.2 which gives me the Valet 404 - Not Found. This is equal to navigating to localhost directly on the host.

The question is: How do I access my sites within the VirtualBox. I tried mapping 10.0.2.2 example.app but it didn't work.

Do you have any suggestions?

Thanks!

Weird Crash

I've been using Valet for 2 months without any issues.

Recently the valet or caddy seem to crash when I load certain .js files on a server rendered page. I tried narrowing down the issue further, without any luck. Once it crashes all valet sites and CLI commands become unresponsive.

I'm using Valet v1.1.16 and Laravel 5.2.

The same code is working fine using Homestead without errors or warnings.

Could someone help me out in debugging this issue?

502 Bad Gateway on Fresh Install

Just installed valet on a fresh install of El Capitan, valet park-ed inside a ~/Sites folder, and get 502 Bad Gateway on any sites I create within.

I have a ~/Sites/test/index.php with <?php each 'Hello World!'; ?> which on request prints the following to the logs:

access.log

127.0.0.1 - [28/Sep/2016:15:25:32 -0400] "GET /server.php HTTP/1.1" 502 16

error.log

28/Sep/2016:15:25:32 -0400 [ERROR 502 /server.php] dial tcp 127.0.0.1:9000: getsockopt: connection refused

Restarting MySQL / MariaDB after reboot

I just spent some time pulling out my hair because it wasn't clear that I had to restart MariaDB after rebooting my computer. I had Valet up and running using MariaDB and all was working great, but after rebooting my machine I couldn't get my site to load. It was giving me the following error:

SQLSTATE[HY000] [2002] Connection refused

After a little digging, I round out that I needed to run the following command to bring MariaDB back up:

brew services start mariadb

The following command also works:

mysql.server start

It would be nice if these details could be added to the Valet docs to help others that are trying to get started with Valet.

"Valet secure" writes bad config and causes daemon/Caddy to crash.

Beginning...

Dnsmasq and PHP are installed via Homebrew:

➜ ~ ls -l /Library/LaunchDaemons/
total 24
-rw------- 1 root wheel 576 Aug 17 15:09 homebrew.mxcl.dnsmasq.plist
-rw------- 1 root wheel 705 Aug 17 15:33 homebrew.mxcl.php70.plist
lrwxr-xr-x 1 root wheel 76 Apr 14 10:54 org.virtualbox.startup.plist -> ../Application Support/VirtualBox/LaunchDaemons/org.virtualbox.startup.plist

Valet installed globally via Computer.

➜ ~ composer global show -i | grep valet
Changed current directory to /Users/mwilliams/.composer
laravel/valet v1.1.18 A more enjoyable local development experience for Mac.

➜ ~ which valet
/Users/mwilliams/.composer/vendor/bin/valet

➜ ~ valet install

Valet installed successfully!

➜ ~ cd Sites
➜ Sites laravel new blog

... lots of typical stuff that happens when you make a new Laravel thing ...

➜ blog valet link
A [blog] symbolic link has been created in [/Users/mwilliams/.valet/Sites/blog].

http://blog.dev/ works! :)

bash-3.2# launchctl list | grep valet | awk '{ print $2 }'
0

Valet daemon is working too, of course.

➜ blog valet secure
The [blog.dev] site has been secured with a fresh TLS certificate.

bash-3.2# launchctl list | grep valet | awk '{ print $2 }'
1

Oh noes! Valet daemon is a gonner :(

bash-3.2# cat /tmp/com.laravel.valetServer.err
2016/08/17 15:11:05 open VALET_HOME_PATH/Log/access.log: no such file or directory

More info:

➜ Sites which php
/usr/local/bin/php
➜ Sites php -v
PHP 7.0.9 (cli) (built: Jul 21 2016 14:50:47) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
➜ Sites

➜ Sites ps aux | egrep -i '(valet|caddy|php|dnsmas)'
nobody 98615 0.0 0.0 2445320 924 ?? Ss 3:43PM 0:00.01 /usr/local/opt/dnsmasq/sbin/dnsmasq --keep-in-foreground -C /usr/local/etc/dnsmasq.conf
mwilliams 99796 0.0 0.0 2432792 588 s004 R+ 3:48PM 0:00.00 egrep -i (valet|caddy|php|dnsmas)
mwilliams 99746 0.0 0.0 2482564 668 ?? S 3:47PM 0:00.00 /usr/local/opt/php70/sbin/php-fpm --fpm-config /usr/local/etc/php/7.0/php-fpm.conf
mwilliams 99745 0.0 0.0 2482564 672 ?? S 3:47PM 0:00.00 /usr/local/opt/php70/sbin/php-fpm --fpm-config /usr/local/etc/php/7.0/php-fpm.conf
root 99741 0.0 0.0 2483588 7772 ?? Ss 3:47PM 0:00.03 /usr/local/opt/php70/sbin/php-fpm --fpm-config /usr/local/etc/php/7.0/php-fpm.conf

Host machine is running OSX 10.11.4.

➜  .valet cat Caddyfile
import /Users/mwilliams/.valet/Caddy/*

:80 {
    fastcgi / 127.0.0.1:9000 php {
        index server.php
    }

    rewrite {
        to /server.php?{query}
    }

    log /Users/mwilliams/.valet/Log/access.log {
        rotate {
            size 10
            age 3
            keep 1
        }
    }

    errors {
        log /Users/mwilliams/.valet/Log/error.log {
            size 10
            age 3
            keep 1
         }
    }
}

➜  .valet cat config.json
{
    "domain": "dev",
    "paths": [
        "/Users/mwilliams/.valet/Sites"
    ]
}

➜  .valet cat Caddy/blog.dev
http://blog.dev:80 {
    redir https://{host}{uri}
}

https://blog.dev:443 {
    tls /Users/mwilliams/.valet/Certificates/blog.dev.crt /Users/mwilliams/.valet/Certificates/blog.dev.key

    fastcgi / 127.0.0.1:9000 php {
        index server.php
    }

    rewrite {
        to /server.php?{query}
    }

    log VALET_HOME_PATH/Log/access.log {       <------- OH NOES?!
        rotate {
            size 10
            age 3
            keep 1
        }
    }

    errors {
        log VALET_HOME_PATH/Log/error.log {    <------- OH NOES?!
            size 10
            age 3
            keep 1
         }
    }
}

WordPress Multisite

Upon migrating some client dev sites to a new Mac running Valet (old Mac is running local installs of PHP, Apache & Mysql and using vhosts for everything), a handful of which are WordPress Multisite installations, I came across an interesting issue where whenever a multisite install of WP is accessed, the request hangs and eventually php crashes and needs to be restarted. I'm assuming this is due to a redirect loop somewhere but nothing shows up in the Caddy logs to verify this, eventually just 'broken pipe' entries.

I'm not sure the best way to handle this as with Apache and Nginx, rewrites are required in order for any site on the multisite 'network' (aside from the root site) to work properly. By default, the 'uploads' directory is no longer used and instead a separate directory called 'blogs.dir' is created with sub directories mapping to each site is used. This could be used in a driver to determine if it's a multisite install, but the requests to that directory would still need to be rewritten due to how wp populates the uri's. As an example: WP uri: http://site.dev/sitename/files/2016/1/image.jpg Actual location: http://site.dev/blogs.dir/siteid/files/2016/1/image.jpg . However another issue here is that multisite can either be enabled as Domain based (subdomains) or Path based (subfolders). This is determined when it's created and a flag is toggled in wp-config determining the type.

The easiest way to handle this I presume would be to add rewrites to the Caddyfile for this, but it looks like there's just a single Caddyfile that applies to all sites (unless I overlooked something) which would prevent this method so I'm not really sure where to go.

Here's the WP doc pages on multisite as well as pages listing rewrite rules needed, etc:
https://codex.wordpress.org/Create_A_Network
https://codex.wordpress.org/Multisite_Network_Administration

Bitnami also publishes both installer packages and pre-built vm images for multisite: https://bitnami.com/stack/wordpress/ - (Local install section on the right)

Repeated rapid POST requests kill Valet on macOS Sierra

Hello. So, I install a new laravel app with the laravel new command. After that I run php artisan make:auth & then php artisan migrate after editing the .env with my connection details.

So, I navigate to /login route and enter a email, and a random password, submit and do that like 1-15 times, until valet just freezing and I have to stop it or valet just dies itself and I have to start it again. There is no actual error, the only "error" I get is in the access.log, and it looks like:

127.0.0.1 - [10/Sep/2016:00:58:38 +0200] "GET /login HTTP/1.1" 200 4755
127.0.0.1 - [10/Sep/2016:00:58:38 +0200] "GET /css/app.css HTTP/1.1" 200 116158
127.0.0.1 - [10/Sep/2016:00:58:38 +0200] "GET /js/app.js HTTP/1.1" 200 294259
127.0.0.1 - [10/Sep/2016:00:58:38 +0200] "GET /favicon.ico HTTP/1.1" 200 0
127.0.0.1 - [10/Sep/2016:00:58:39 +0200] "POST /login HTTP/1.1" 302 328
-------1-------2-------7-------.-------0-------.-------0-------.-------1------- --------------- -------[-------1-------0-------/-------S-------e-------p-------/-------2-------0-------1-------6-------:-------0-------0-------:-------5-------8-------:-------3-------9------- -------+-------0-------2-------0-------0-------]------- -------"-------G-------E-------T------- -------/-------l-------o-------g-------i-------n------- -------H-------T-------T-------P-------/-------1-------.-------1-------"------- -------2-------0-------0------- -------{-------s-------i-------z-------e-------}-------

Worth to mention, I have tried with both mariadb setup & sqlite, also uninstalled & installed valet. Still the same. Do anyone have any idea what can possibly cause this? Thanks!

EDIT: And sometimes it adds the text "Internal Server Error" to the bottom of the page, it stays there even if i reload the page. https://drops.blogster.se/QkSypk3lo6.png

EDIT2: Forgot to mention, I am running macOS Sierra version 10.12 beta (16A313a).

Make Caddy a brew dependency

I just did:

brew install caddy

And this is working just fine, i got the latest caddy version:

$ caddy --version
Caddy 0.9.1

Is there any reason to not use it and have the bin on repo?

Error establishing a database connection

Sorry of this is out of scope for this repo, but I've followed tutorials for installing Wordpress on Valet, and, despite being able to connect through Sequel Pro to the local database on localhost/127.0.0.1, Wordpress sites aren't able to connect to it. Anyone have any ideas on what could be causing this? I checked my hosts file, checked to make sure nothing else is listening on port 80, etc...

Valet response too long

Hi , i'm using valet for about one month but sometimes it takes about more than 1 minute to respond event if i'm just returning "Hello World!" , i'm trying to figure out the problem but nothing until now , any idea ?

  • updates : when i use file_get_contents() it take so long

Running Valet causes sudoer error

When I run valet, I get an error in valet & brew's sudoer.

>>> /etc/sudoers.d/brew: Alias `BREW' already defined near line 1 <<<
>>> /etc/sudoers.d/valet: Alias `VALET' already defined near line 1 <<<
sudo: parse error in /etc/sudoers.d/brew near line 1
sudo: no valid sudoers sources found, quitting

Valet randomly cycling through sites and page elements

Having a really weird issue where - when visiting a local site - Valet will cycle through elements of the page (CSS files, images, jQuery, etc.) and display them, as if I'd opened the file directly in my browser. Each time I refresh, I see a new element.

If that's not weird enough, I'll open another site, and Valet will continue displaying the first site, then, as I refresh, Valet will show elements between both sites, drop Bootstrap padding, regain the padding, show a 502 Bad Gateway error... just random craziness.

When hitting a new .dev site in my browser I'd -on average - have to refresh about 5 times before seeing the new site.

~/.valet/Log/access.log is basically lots of this

127.0.0.1 - [21/Sep/2016:21:23:01 -0400] "GET /server.php HTTP/1.1" 200 42
127.0.0.1 - [21/Sep/2016:21:23:09 -0400] "GET /server.php HTTP/1.1" 200 42
127.0.0.1 - [21/Sep/2016:21:23:11 -0400] "GET /server.php HTTP/1.1" 200 2321

Valet crashes unexpected

When using Valet the service crashes and no response is given to .dev addresses.
The Console says:
Sep 22 12:19:08 aekmbp com.apple.xpc.launchd1: Service exited with abnormal code: 2

"Domain" should maybe be "TLD"?

Every time I read the command domain I think it has to do with the domain (e.g. burgermergency) of the folder I'm in. When I think of the "ending" (.com, .net, etc.) I think of that as the TLD.

I want to ask before I PR, because I don't know if everyone else thinks of this different from me. But I'd propose changing domain to tld so it's clearer that it's not talking about the domain of the current folder you're in, but instead your global tld for Valet.

Thoughts?

Valet secure && valet share not working properly

I am trying to access the generated url by valet share on my iPhone but is not working.
Apparently it is only redirect to my valet local address, but that url is not available on the web, how can I fix it?

v1.1.22 using laravel/framework v5.2.45 using symphony/http-foundation v.3.0.9 : cannot redeclare info() error

Here's my current setup:

  • laravel/valet v1.1.22
  • laravel/framework v5.2.45
  • symfony/http-foundation v3.0.9

Installing valet while using the laravel/framework v5.2 works fine. But immediately errors pop up when doing valet start.

PHP Fatal error: Cannot redeclare info() (previously declared in /Users/nateritter/.composer/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php:454) in /Users/nateritter/.composer/vendor/laravel/valet/cli/includes/helpers.php on line 21

So, I thought and try to go wrap a conditional into the /valet/cli/includes/helpers.php to check if the function has been declared. But when doing that and then running any commands which utilize the info() method, I get the following:

[ReflectionException]     
Class log does not exist

Valet didn't respect domain (other than DEV) after upgrade

Having upgraded to Sierra, I also did a global composer update and valet install to sweep through any changes made by you guys.

I then had issues accessing my projects. The IP address returned as 172.0.53.53.

Having first checked valet domain to ensure it was still set, I did some troubleshooting. DNSMasq was still configured to use .dev, so I had to re-run valet domain app (app being my preferred domain extension) and then restart dnsmasq. It seems that while valet was publishing my customised domain using valet domain, it had reset the actual settings to the default during the upgrade.

I followed the instructions here: https://laravel.com/docs/5.3/valet#upgrading

First Valet needed Brew, now it has Brew but still returns an error

Hi there,

Love Valet. Great job.
Had some problems with my $PATH on OSX, so I removed most of it.

Valet stopped working and I can't get it to work again. It throws an error and still says it works, but in the browser it shows a Valet - Not found 404 error.

This is the message I get when using the valet start command:

Warning: array_filter() expects at most 2 parameters, 3 given in /Users/lourens/.composer/vendor/tightenco/collect/src/Illuminate/Support/Arr.php on line 504

Warning: array_filter() expects at most 2 parameters, 3 given in /Users/lourens/.composer/vendor/tightenco/collect/src/Illuminate/Support/Arr.php on line 504

Warning: array_filter() expects at most 2 parameters, 3 given in /Users/lourens/.composer/vendor/tightenco/collect/src/Illuminate/Support/Arr.php on line 504

Warning: array_filter() expects at most 2 parameters, 3 given in /Users/lourens/.composer/vendor/tightenco/collect/src/Illuminate/Support/Arr.php on line 504

Warning: array_filter() expects at most 2 parameters, 3 given in /Users/lourens/.composer/vendor/tightenco/collect/src/Illuminate/Support/Arr.php on line 504

I do have ~/.composer/vendor/bin in my $PATH.

At first Valet stated I needed Brew installed (which I had) but I fixed that. Think Valet was looking for Brew in a different location.

which valet: /usr/local/bin/valet
which composer: /usr/local/bin/composer

No log files were found (valet logs), it has the latest version.

I can't view any of the websites through Valet and this is really frustrating. I hope you can show me the way.

Cheers

Valet webserver permissions

On mac, the valet webserver runs under the user _www.

Laravel new however sets it up under the current user.

Without rights valet cannot cache blade, make log files, etc.

So I'm wondering why it works out of the box in examples like this.

Support CraftCMS localization

I believe I'm running into some issues when trying to get valet to play nice with Craft's localization - https://craftcms.com/docs/localization-guide

I'm using the multiple locale folders in the /public webroot but when trying to access these pages I'm getting a 404.

In my specific example i've got:

public/index.php
public/au/index.php
public/us/index.php

The second two files have their respective:

$craftPath = '../../craft';
define('CRAFT_LOCALE', 'en_au');

Just wondering if anyone has some ideas how we might update the driver to support this or to look at a custom Caddy rewrite rule to get it working (https://forum.caddyserver.com/t/craftcms-locale-rewrites-with-valet/728 had posted over there before I realised that valet has official support for Craft)

Add CSS MIME type/subtype

I'm just starting to use Valet, and one issue I noticed is that it doesn't seem to serve CSS files with the correct MIME type/subtype by default. Specifically, the error I received in Chrome's console was:

Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://xxx.dev/css/theme.css".

CSS should be served with a MIME type/subtype of text/css. Thank you!

Ngrok arguments supported?

Hi!

I bought a paid Ngrok account and would like to do valet share with arguments like --region ap --subdomain custom_domain.

Is it possible to set such arguments for every site I share or globally for Valet?

server-log command: access log not really useful

Running:

  • macOS 10.11.6 El Capitan
  • Valet 1.1.22

Issue

When running valet server-log to get insights on the server log files, especially the access log, this is the output in the terminal:

==> /Users/<username>/.valet/Log/access.log <==
127.0.0.1 - [30/Sep/2016:16:22:47 +0200] "GET /server.php HTTP/2.0" 200 0
127.0.0.1 - [30/Sep/2016:16:30:33 +0200] "OPTIONS /server.php HTTP/2.0" 200 0
127.0.0.1 - [30/Sep/2016:16:30:33 +0200] "POST /server.php HTTP/2.0" 200 280
127.0.0.1 - [30/Sep/2016:16:30:33 +0200] "OPTIONS /server.php HTTP/2.0" 200 0
127.0.0.1 - [30/Sep/2016:16:30:33 +0200] "OPTIONS /server.php HTTP/2.0" 200 0
127.0.0.1 - [30/Sep/2016:16:30:33 +0200] "OPTIONS /server.php HTTP/2.0" 200 0
127.0.0.1 - [30/Sep/2016:16:30:34 +0200] "GET /server.php HTTP/2.0" 304 0
127.0.0.1 - [30/Sep/2016:16:30:34 +0200] "GET /server.php HTTP/2.0" 304 0
127.0.0.1 - [30/Sep/2016:16:30:34 +0200] "GET /server.php HTTP/2.0" 304 0
127.0.0.1 - [30/Sep/2016:16:30:34 +0200] "GET /server.php HTTP/2.0" 200 312430

That is, in my eyes, only party useful. It would be much better, to get the actually called uris there, instead of server.php everytime.

Is this an issue on my side or is that the intended behaviour?

Idea: Valet environment variables

I have been using valet for a while and love it! I think it would pretty damn cool for Valet to automatically load any environment variables contained in a .env file into the virtual host declaration within caddy for the site. It could even be an optional command such as valet load:env or something like that. Does anyone else think this is a feature worthy of being worked on? If so, I might take it up and do a PR

Unable to Update Valet

➜  vagrant-config git:(master) valet update
/Users/alexbowers/.composer/vendor/laravel/valet/cli/scripts/update.sh: line 4: /Users/alexbowers/.valet-cli/valet: No such file or directory
Downloading latest release of Valet...
/Users/alexbowers/.composer/vendor/laravel/valet/cli/scripts/update.sh: line 18: jq: command not found
(23) Failed writing body
Installing Valet's Composer dependencies...

Valet installed successfully!
/Users/alexbowers/.composer/vendor/laravel/valet/cli/scripts/update.sh: line 31: /Users/alexbowers/.valet-cli/valet: No such file or directory
➜  vagrant-config git:(master) valet --version
Laravel Valet version 1.1.12

Server not found, Can't find DNS (127.0.53.53)

HI. Please help me. Valet isn't working. No, it's working but not properly. I installed my osx and created user admin. I started to work on it, installed composer, laravel, valet. After i created new user and deleted the old. After this I can't acces sites from Valet(( Please help me. Maybe i have to uninstall all what is everything's about valet, but how?
captura de ecran din 2016 08 16 la 13 21 10

[Proposition] Subdirectory as subdomain?

Hi!

I have looked at Valet, it's just awesome! Probably it will replace Docker and Vagrant for me to quick development in my machine. But, there's a little suggestion.

For example: I'm working on some companies, and my naming of directories are: ~/Sites/[company-name]/[project]. My domains are: project-name.company.dev.

I think it could be a great feature as root directory could be domain name, and subdirectory - subdomain. Of course, I think also it should be configurable (use naming in current one, or in my suggestion).

What are you think about it?

Allow multiple subdomains

I have a site that does routing based on the subdomain, so in order to serve this in valet I have to make the following change to server.php:

if (strpos($siteName, 'www.') === 0) {
    $siteName = substr($siteName, 4);
}

to

if (strstr($siteName, '.')) {
    $siteName = substr($siteName, strpos($siteName, '.') + 1);
}

It would be awesome if this were either the default or configurable.

Valet and large file uploads

Hey guys -

Today I installed Valet with the hopes of replacing Homestead. I'm running Laravel 5.2 with dropzone.js (dropzonejs.com) to upload files. I don't have any issues in Homestead, but in Valet I start getting weird errors if I try to upload any file that's over 2.2 MB. Sometimes the validation in my controller is triggered and complains that the named file is required:

{my-photo: ["The my-photo field is required."]}

And sometimes I'll get weird memory errors like this:

FatalErrorException: Allowed memory size of 134217728 bytes exhausted (tried to allocate 48000001 bytes)

Notice that in the above error, it's complaining that it's trying to allocate 48 MB but my memory limit is set to 128 MB so this shouldn't be an issue.

Any ideas of how I can get around this?

Thanks!

Tommy

Change valet port

Right now we use port 9000, this can be a pain since xdebug uses 9000 by default too. Switching to a different port here will remove the extra pain of having to customize your xdebug environment for step through debugging.

If there's a better way to do step through debugging these days that I don't know about, I'd love to know :)

Missing Share command from the list of commands

Hello, I am very new to this stuff so sorry if my proposal is bad or wrong.

I just noticed that when you run valet in terminal, the share command doesn't get listed (and it is one of valet's main benefits), I tried adding the command to the valet/cli/valet.php document but I dont know what the closure should do, so the boilerplate would be something like

$app->command('share', function () { //function here })->descriptions('Generate a publicly accessible URL for your project');

Thanks for all the great work! Hope this helps in some way

Drupal driver not found (even when not in use)

1.1.14 to 1.1.16 give this error when valet is trying to select the right driver:

Warning: require_once(/Users/me/.composer/vendor/laravel/valet/cli/drivers/DrupalValetDriver.php):
 failed to open stream: No such file or directory in /Users/me/.composer/vendor/laravel/valet/cli/drivers/require.php on line 26

This is presumably because the Drupal driver added in #48 was put at /valet/drivers/DrupalValetDriver.php instead of /valet/cli/drivers/DrupalValetDriver.php

I've confirmed that relocating it to the /valet/cli/drivers/ folder (where all the other drivers are found) gets rid of the error and lets previously-functioning sites work correctly again.

Change port 80 to other port.

Hey,

would it be possible to make the port configurable, so that port 80 is not used?
I currently have a problem when running other services, since they use port 80 as well.

Valet link not working for volumes including a space

I have some sites on a volume called Macintosh HD

valet link foldername says link has been created, and no error is reported

valet links shows no such symlink

The valet sites folder does not contain the link just requested.

Valet link to a folder in a different volume works fine.

The only thing unusual about the volume is the space in the name. This has been an issue with some other scripts that do not quote the path.

Upgrade path

A valet upgrade command would be neat. With #159 as an example, we could set up migration classes that modify the environment up or down like this:

<?php
namespace Valet\Migration;

use Valet\Brew;
use Valet\CommandLine;
use Valet\Filesystem;
use Valet\PhpFpm;

class Migration159
{

    public function up(Brew $brew, CommandLine $cli, Filesystem $files, $backupPath)
    {
        // Update fpm
        $fpm = new PhpFpm($brew, $cli, $files);
        $fpmConfig = $fpm->fpmConfigPath();
        $files->copy($fpmConfig, $backupPath . '/fpm.conf');
        $fpm->updateConfiguration();

        // Update caddy files
        ...
    }

    public function down(Brew $brew, CommandLine $cli, Filesystem $files, $backupPath)
    {
        // Revert fpm file
        $fpm = new PhpFpm($brew, $cli, $files);
        $fpmConfig = $fpm->fpmConfigPath();
        $files->copy($backupPath . '/fpm.conf', $fpmConfig);

        // Revert caddy files
        ...
    }

}

This gives us a simple upgrade path and allows us to downgrade in the event that something breaks. Thoughts?

Unable to play video

I am finding that video files will not play in Valet as mp4, ogg, ogv or webm. I have tried adding Mime types within the .htaccess, but looking at cli/mimes.php thy should already be there?

Is there any way I can get around this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.