weprovide / valet-plus Goto Github PK
View Code? Open in Web Editor NEWBlazing fast macOS PHP development environment
Blazing fast macOS PHP development environment
First of all, thanks a lot for making and open sourcing Valet Plus.
In the installation instructions, step 2 says
Install PHP 7.0 using Homebrew via
brew install homebrew/php/php70
.
I used PHP 7.1 instead, and it seems to work fine. I'm curious, why does the documentation specify PHP 7.0?
I tried switching to 5.6 and got the following errors:
Sander-mc:project sander$ valet use 5.6
Stopping php70...
Password:
Stopping php71...
Stopping nginx....
Unlinking /usr/local/Cellar/php70/7.0.20_12... 17 symlinks removed
Installing php56...
[php56] is not installed, installing it now via Brew... 🍻
Warning: Already linked: /usr/local/Cellar/php56/5.6.30_6
To relink: brew unlink php56 && brew link php56
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-ssh2/ssh2.so' - dlopen(/usr/local/opt/php56-ssh2/ssh2.so, 9): image not found in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-ssh2/ssh2.so' - dlopen(/usr/local/opt/php56-ssh2/ssh2.so, 9): image not found in Unknown on line 0
PHP Parse error: syntax error, unexpected '' - dlopen(/usr/local/opt/php5' (T_CONSTANT_ENCAPSED_STRING) in Command line code on line 3
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-ssh2/ssh2.so' - dlopen(/usr/local/opt/php56-ssh2/ssh2.so, 9): image not found in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-ssh2/ssh2.so' - dlopen(/usr/local/opt/php56-ssh2/ssh2.so, 9): image not found in Unknown on line 0
PHP Parse error: syntax error, unexpected '' - dlopen(/usr/local/opt/php5' (T_CONSTANT_ENCAPSED_STRING) in Command line code on line 3
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-ssh2/ssh2.so' - dlopen(/usr/local/opt/php56-ssh2/ssh2.so, 9): image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-ssh2/ssh2.so' - dlopen(/usr/local/opt/php56-ssh2/ssh2.so, 9): image not found in Unknown on line 0
Could not open input file:
Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-ssh2/ssh2.so' - dlopen(/usr/local/opt/php56-ssh2/ssh2.so, 9): image not found in Unknown on line 0
Parse error: syntax error, unexpected '' - dlopen(/usr/local/opt/php5' (T_CONSTANT_ENCAPSED_STRING) in Command line code on line 3/cli/valet.php
Restarting php56...
Restarting nginx...
Valet is now using php5.6.
Sander-mc:project sander$ brew unlink php56 && brew link php56
Unlinking /usr/local/Cellar/php56/5.6.30_6... 17 symlinks removed
Linking /usr/local/Cellar/php56/5.6.30_6... 17 symlinks created
Sander-mc:project sander$ valet use 5.6
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-ssh2/ssh2.so' - dlopen(/usr/local/opt/php56-ssh2/ssh2.so, 9): image not found in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-ssh2/ssh2.so' - dlopen(/usr/local/opt/php56-ssh2/ssh2.so, 9): image not found in Unknown on line 0
PHP Parse error: syntax error, unexpected '' - dlopen(/usr/local/opt/php5' (T_CONSTANT_ENCAPSED_STRING) in Command line code on line 3
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-ssh2/ssh2.so' - dlopen(/usr/local/opt/php56-ssh2/ssh2.so, 9): image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-ssh2/ssh2.so' - dlopen(/usr/local/opt/php56-ssh2/ssh2.so, 9): image not found in Unknown on line 0
Could not open input file:
Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-ssh2/ssh2.so' - dlopen(/usr/local/opt/php56-ssh2/ssh2.so, 9): image not found in Unknown on line 0
Parse error: syntax error, unexpected '' - dlopen(/usr/local/opt/php5' (T_CONSTANT_ENCAPSED_STRING) in Command line code on line 3/cli/valet.php
Sander-mc:project sander$ valet use 7
[... same errors ...]
Sander-mc:project sander$ valet install
[... same errors ...]
Eventually I fixed it by reinstalling ssh2 manually through homebrew: brew reinstall php56-ssh2 --build-from-source
, switching to 7.0 and back to 5.6 then succeeded. I'm not sure if this is due to my local setup as I might have had some form of php already installed.
It is trivial to add, but it would be nice if PimpMyLog was added by default. http://pimpmylog.com/
When you have static sign enabled urls become: /static/version<numbers>/path
which leads to a 404.
pbcopy ~/.ssh/id_rsa.pub
Has to be added to the php.ini, cause Symfony requires it.
This is an issue caused by the last pr, on ~/.composer/vendor/weprovide/valet-plus/cli/Valet/Filesystem.php line 200, it is calling $this->chown($to, user());
and getting the empty string. I am not sure which user to default to here.
The installation process fails when mariadb was already installed with brew:
Error: Cannot install mysql because conflicting formulae are installed.
mariadb: because mysql, mariadb, and percona install the same binaries.
...
The flexibility of valet+ is what makes it a plus for me - that should include using it with mariadb.
The documentation gives no hint what I should do when I have already valet installed - is there an upgrade path? Should I remove valet?
This seems to be a very common situation: user found valet, then after some while, looking for more features, she finds valet+ so some words about how to upgrade / convert should address many people.
BTW: very nice project! Thank you for your efforts!
Open closest git project in phpstorm
Add xdebug on/off switch
Installation was simple, easy and no problems, but it installed 7.1 by default. So when using valet use 7.0
I get the following error:
...
Error: The 'brew link' step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink include/apc.h
Target /usr/local/include/apc.h
...
Switching back to 7.1 and once more to 7.0 fixed it. Seems after the first time switching it can remove the symlinks properly. Here's the full log:
Sander-mc:sk2k sander$ valet use 7.0
Stopping php70...
Password:
Stopping php71...
Stopping nginx....
Unlinking /usr/local/Cellar/php71/7.1.6_18... 17 symlinks removed
Linking /usr/local/Cellar/php70/7.0.18_10... 17 symlinks created
Stopping nginx....
Stopping php70...
Stopping php71...
Stopping mysql....
Stopping redis....
Installing developer tools...
wp-cli already installed
n98-magerun already installed
n98-magerun2 already installed
pv already installed
Installing nginx configuration...
Installing nginx directory...
Updating PHP configuration...
Install PHP extensions...
Installing php70-apcu...
[php70-apcu] is not installed, installing it now via Brew... 🍻
==> Installing php70-apcu from homebrew/php
==> Installing dependencies for homebrew/php/php70-apcu: php70
==> Installing homebrew/php/php70-apcu dependency: php70
==> Downloading https://homebrew.bintray.com/bottles-php/php70-7.0.20_12.sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/fe/fe50ba13b4c532cfbfae91e69739d5117d141a5182fde5dcaf54ea3666f0c45e?__gda__=exp=1499181807~hmac=4e3586acbad6658a6caca2d1108e373907c5f48163ab213042dab68273d9d540&response-content-disposition=attachment%3Bfilename%3D%22php70-7.0.20_12.sierra.bottle.tar.gz%22&response-content-type=application%2Fgzip&requestInfo=U2FsdGVkX18V8s0BUHvQDH0QMKo3V3q75GaRrXYkd8pMbLiXtXlgyF3JjvAa7TWV8G6TJM20N0LHPWJGwdSEy2_fbD4IOlmolp4JOCs96alvE54VmQaqTwvc-ftxaMqRYH9SWEl-LAyUcREF8L_vxA
==> Pouring php70-7.0.20_12.sierra.bottle.tar.gz
==> Caveats
The php.ini file can be found in:
/usr/local/etc/php/7.0/php.ini
✩✩✩✩ Extensions ✩✩✩✩
If you are having issues with custom extension compiling, ensure that you are using the brew version, by placing /usr/local/bin before /usr/sbin in your PATH:
PATH="/usr/local/bin:$PATH"
PHP70 Extensions will always be compiled against this PHP. Please install them using --without-homebrew-php to enable compiling against system PHP.
✩✩✩✩ PHP CLI ✩✩✩✩
If you wish to swap the PHP you use on the command line, you should add the following to ~/.bashrc, ~/.zshrc, ~/.profile or your shell's equivalent configuration file:
export PATH="$(brew --prefix homebrew/php/php70)/bin:$PATH"
✩✩✩✩ FPM ✩✩✩✩
To launch php-fpm on startup:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/opt/php70/homebrew.mxcl.php70.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php70.plist
The control script is located at /usr/local/opt/php70/sbin/php70-fpm
OS X 10.8 and newer come with php-fpm pre-installed, to ensure you are using the brew version you need to make sure /usr/local/sbin is before /usr/sbin in your PATH:
PATH="/usr/local/sbin:$PATH"
You may also need to edit the plist to use the correct "UserName".
Please note that the plist was called 'homebrew-php.josegonzalez.php70.plist' in old versions of this formula.
With the release of macOS Sierra the Apache module is now not built by default. If you want to build it on your system you have to install php with the --with-httpd24 option. See brew options php70 for more details.
To have launchd start homebrew/php/php70 now and restart at login:
brew services start homebrew/php/php70
==> Summary
🍺 /usr/local/Cellar/php70/7.0.20_12: 337 files, 38.6MB
==> Installing homebrew/php/php70-apcu
==> Downloading https://homebrew.bintray.com/bottles-php/php70-apcu-5.1.8.sierra.bottle.tar.gz
==> Pouring php70-apcu-5.1.8.sierra.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink include/apc.h
Target /usr/local/include/apc.h
is a symlink belonging to php71-apcu. You can unlink it:
brew unlink php71-apcu
To force the link and overwrite all conflicting files:
brew link --overwrite php70-apcu
To list all files that would be deleted:
brew link --overwrite --dry-run php70-apcu
Possible conflicting files are:
/usr/local/include/apc.h -> /usr/local/Cellar/php71-apcu/5.1.8/include/apc.h
/usr/local/include/apc_arginfo.h -> /usr/local/Cellar/php71-apcu/5.1.8/include/apc_arginfo.h
/usr/local/include/apc_cache.h -> /usr/local/Cellar/php71-apcu/5.1.8/include/apc_cache.h
/usr/local/include/apc_cache_api.h -> /usr/local/Cellar/php71-apcu/5.1.8/include/apc_cache_api.h
/usr/local/include/apc_globals.h -> /usr/local/Cellar/php71-apcu/5.1.8/include/apc_globals.h
/usr/local/include/apc_iterator.h -> /usr/local/Cellar/php71-apcu/5.1.8/include/apc_iterator.h
/usr/local/include/apc_lock.h -> /usr/local/Cellar/php71-apcu/5.1.8/include/apc_lock.h
/usr/local/include/apc_lock_api.h -> /usr/local/Cellar/php71-apcu/5.1.8/include/apc_lock_api.h
/usr/local/include/apc_pool.h -> /usr/local/Cellar/php71-apcu/5.1.8/include/
[DomainException]
Brew was unable to install [php70-apcu].
install
apc_pool.h
/usr/local/include/apc_pool_api.h -> /usr/local/Cellar/php71-apcu/5.1.8/include/apc_pool_api.h
/usr/local/include/apc_sma.h -> /usr/local/Cellar/php71-apcu/5.1.8/include/apc_sma.h
/usr/local/include/apc_sma_api.h -> /usr/local/Cellar/php71-apcu/5.1.8/include/apc_sma_api.h
/usr/local/include/apc_stack.h -> /usr/local/Cellar/php71-apcu/5.1.8/include/apc_stack.h
/usr/local/include/php_apc.h -> /usr/local/Cellar/php71-apcu/5.1.8/include/php_apc.h
==> Caveats
To finish installing apcu for PHP 7.0:
* /usr/local/etc/php/7.0/conf.d/ext-apcu.ini was created,
do not forget to remove it upon extension removal.
* Validate installation via one of the following methods:
*
* Using PHP from a webserver:
* - Restart your webserver.
* - Write a PHP page that calls "phpinfo();"
* - Load it in a browser and look for the info on the apcu module.
* - If you see it, you have been successful!
*
* Using PHP from the command line:
* - Run `php -i "(command-line 'phpinfo()')"`
* - Look for the info on the apcu module.
* - If you see it, you have been successful!
==> Summary
🍺 /usr/local/Cellar/php70-apcu/5.1.8: 23 files, 160.3KB
Restarting php70...
Restarting nginx...
Valet is now using php7.0.
You can use valet db export
inside the right directory and it'll export the database of that directory to [name].sql
. If you want to change the name of the file, you have to use valet db export [db] [filename]
which makes you retype the current directory. If the directory and filename parameters are reversed you can use valet db export [filename]
, which uses the current directory if omitted.
I keep typing valet db export dir filename.sql
so I end up with filename.sql.sql
, I expect to have to type in the full filename.
If you can add a date (or date-time) format to the default sql name, I probably don't have to use the full command as much to change the name, since I usually add the date of the export.
Before, when I was using Ampps, I had setup a .htaccess file in my public folder (next to my index.php file).
Now, none of my routes do anything anymore.
My .htaccess file looked like this:
Options -MultiViews
RewriteEngine On
RewriteBase /project-name
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
Since the url was something annoying like localhost/project-name/public/(users, etc.), I wanted to switch to something better.
My project is almost 100% my own code, since it is mostly a learning platform for me, where I can learn setting up a basic framework and work up from there, gaining more front-end and back-end experience.
My Router.php contains the following, please bear in mind I created this in one go, and did not refactor a lot etc.
<?php
namespace App\Core\Routing;
/**
* Class Router.
*/
class Router
{
/**
* @throws \Exception
*/
public static function init()
{
if (!Route::isValidRoute() && !Route::isAssetRoute()) {
throw new \RuntimeException('404: Route does not exist');
}
$url = get('url') ?: '';
if (Route::isAssetRoute()) {
if (stripos($url, '.js') >= 0) {
header("Content-Type: Application/Javascript");
} elseif (stripos($url, '.css') >= 0) {
header("Content-Type: text/css");
}
echo \File::get(APP_PATH . '/' . $url);
exit;
}
Route::executeCallback();
exit;
}
}
The routes I create in my routes.php file use a Route class, which look like this (same warning)
<?php
namespace App\Core\Routing;
use Closure;
/**
* Class Route.
*/
class Route
{
/**
* @var array
*/
private static $routes = [];
/**
* @param $route
* @param $method
*/
public static function get($route, $method)
{
self::setRoutes('GET', $route, $method);
}
/**
* @param $route
* @param $method
*/
public static function post($route, $method)
{
self::setRoutes('POST', $route, $method);
}
/**
* @return array
*/
public static function getRoutes(): array
{
return self::$routes;
}
/**
* @param $requestMethod
* @param $route
* @param $method
*
* @internal param array $routes
*/
public static function setRoutes($requestMethod, $route, $method)
{
self::$routes[$requestMethod][$route] = $method;
}
/**
* @return bool
*/
public static function isValidRoute(): bool
{
$url = get('url');
return empty(get()) ?: array_key_exists($url, self::getRoutes()[$_SERVER['REQUEST_METHOD']]);
}
/**
* @return bool
*/
public static function isAssetRoute(): bool
{
$url = get('url');
return !empty(get()) && stripos($url, 'public/assets') !== false;
}
/**
* @throws \BadMethodCallException
*/
public static function executeCallback()
{
$callback = self::getIfExists();
if ($callback instanceof Closure) {
$callback->__invoke();
return;
}
if (
is_string($callback)
&& (strpos($callback, '@') !== false
|| strpos($callback, '::') !== false)
) {
$parts = explode('@', $callback);
if (count($parts) > 1) {
//Todo: automatically get the namespace
$class = 'App\\Controllers\\' . $parts[0];
$class = new $class();
$method = $parts[1];
$class->$method();
return;
}
//Todo: do this and simplify check;
return;
}
if (!$callback) {
//Callback could not be found or does not exist
return;
}
throw new \BadMethodCallException('Callback is not supported');
}
/**
* @return bool|Closure
*/
public static function getIfExists()
{
$requestMethod = $_SERVER['REQUEST_METHOD'];
$url = get('url');
$routes = self::getRoutes();
if (empty($url)) {
$url = '/';
}
return (
array_key_exists($requestMethod, $routes)
&& array_key_exists($url, $routes[$requestMethod])
) ? $routes[$requestMethod][$url] : false;
}
}
Am I doing something wrong? Am I missing something?
My routes worked (mostly, only a single level route worked) in Ampps, but now only the homepage works.
Right now Magento 2 can only be installed through the command line with bin/magento setup:install ...
or n98-magerun2 install
. Is it possible to allow through local.dev/setup
as well?
I have not tested this but I imagine similar problems with other packages like Wordpress?
This would make it a lot more accessible to people with less experience with the command line.
It might be useful to add some short installation instruction for Magento(2) using n98-magerun(2) install
or even add a valet magerun2 install command or something like that ;)
I'm not a part of the Valet project, but I care about people handling things well, so I'm going to say something.
This project should have a new and unique name. In my totally-un-asked-for opinion, Valet+ is not an appropriate name for something that's not run by the people who created the original Valet. It's akin to forking Laravel and naming it Laravel$$$, or forking Drupal and naming it Drupal*.
--
As an aside, I'd also suggest burying the fact that the core of this code is Valet--that this project is Valet, with some modifications--a wee bit less. That's a bit of a separate issue, but again goes to the healthy and respectful relationship to the originator of code you forked.
❤️
When I cloned my project in ~/sites/project-name
, I saw many warnings related to the timezone.
Europe/Amsterdam is perfect, as I am from the Netherlands, but it appears to be set incorrectly?
I've tried setting it in my own script, (not even using DateTime btw, only using Nesbot's Carbon package) but that still shows the errors.
After scrolling down a bit, I can also see an exception is thrown. These errors and exception are even showing up if I do the following on the first line of my script: phpinfo();die;
.
Here is a (full) screenshot of my phpinfo: link
Hi, it seems that the apc.shm_size
is too high for my setup. Having it set to 2048M
I get the following error when using PHP (e.g. php -v
)
PHP Fatal error: PHP Startup: apc_mmap: ftruncate failed: in Unknown on line 0
When I set it lower, to say 512M
, PHP works perfectly with APCU.
Would there be a way to set this dynamically somehow from a config? Now I need to manually change the cli/stubs/z-performance.ini
for PHP version switches to work properly. Or I need to set the value in /usr/local/etc/php/x.y/conf.d/z-performance.ini
manually each time.
Maybe the PHP error log should also be in the same location. (~/.valet/Log
)
It would be amazing if we could switch php version per project directory. I have not set this up myself but a college of mine did: https://medium.com/@wvervuurt/how-to-run-multiple-php-versions-simultaneously-under-os-x-el-capitan-using-standard-apache-98351f4cec67
I'm not sure if this way is compatible with the way Valet+ is setup?
I tried to setup the valet web server and it's okay because and I can try like "example.dev". However, I can't connect to the db or do anything relating the db.
This is the screenshot of my error: link
Any ideas about this problem?
Thanks in adance.
Would be very convenient to have the Head plugin installed with ES. This makes all indexes browsable and gives much insight. Very convenient for developers.
See https://github.com/mobz/elasticsearch-head for installation notes.
After installing the head plugin you should be able to browse to http://elasticsearch.dev/_plugin/head/
I have installed https://github.com/aaemnnosttv/wp-cli-valet-command and was adding a user, and when I ran it I get the following error:
Don't go anywhere, this should only take a second...
Success: sample ready! https://sample.Notice: Undefined index: USER in /Users/riskiii/.composer/vendor/weprovide/valet-plus/cli/includes/helpers.php on line 175
Notice: Undefined index: USER in /Users/riskiii/.composer/vendor/weprovide/valet-plus/cli/includes/helpers.php on line 175
dev
I suspect the error is on this side, since USER is not declared before it is returned, but if not, I can file it with wp-cli-valet-command.
Hey,
i wanted to try out valet-plus, but there is missing stuff in readme.
Problem with database:
mysql -u root -proot DBNAME < database.sql
So far looking good keep it up! 🚀
When you use 'valet db import [file]' but the database doesn't exist yet, you get the error ERROR 1049 (42000): Unknown database 'project'
. It would be nice if the database is created if it doesn't exist.
Also I use 'valet db drop && valet db create && db import [file]' as a one-liner for re-installing a database, if that could be 'valet db reimport [file]', that would be awesome!
Created scripts to automate the install valet-plus by first checking to see if any other web server is running, and kill them.
https://campfirepixels.com/automated-way-to-install-valet-plus-by-weprovide/
valet-plus-list
[email protected]:ca96e5face7cd1f02ce62aad490cfe2d.git
valet-plus-destroy
[email protected]:5b74ba708d7bf8621c1cb6b959ece99f.git
valet-plus-install
[email protected]:ccaa9712cb5bdc73e43276a63643366b.git
valet elasticsearch install
installs Elasticsearch 2.4.
I started digging into this because I have some issues with fielddata on bin/console fos:elastica:populate
:
[Elastica\Exception\ResponseException]
fielddata should be a hash but was of type: class java.lang.Boolean [reason: Failed to parse mapping [text]: fielddata should be a hash
but was of type: class java.lang.Boolean]
This used to work when I had simply run brew install elasticsearch && brew services start elasticsearch
. To be clear, I'm not 100 % sure about this, as I haven't troubleshooted it for fear of messing up my brand new Valet Plus (and macOS) install.
brew info elasticsearch
gives the following result:
elasticsearch: stable 5.5.2, HEAD
…
I have two questions:
valet elasticsearch install
?Parse error: syntax error, unexpected '' - dlopen(/usr/local/opt/php7' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ')' in Command line code on line 3/cli/valet.php
Got this error on calling valet install
.
I have installed php71, on a 2016 macbook pro, latest updates.
He, I could have a look to make this myself but I'm not sure about other platform compatibility and what gzip progs to use etc, but it would be great if the db export/dump can directly pipe the sql into a .gz file. Also reading a .gz file on import/reimport would be awesome! Space is valuable ;)
In general the Readme is excellent. I found one typo, however that is a quick fix.
Where it reads:
echo "<?php echo 'Valet+ at your service'" > index.php
It should read
echo "<?php echo 'Valet+ at your service';" > index.php
The only difference is the semicolon after service'
.
As it is now, the command results in a PHP error.
It's hard to pinpoint what is going on, but after certain actions involving Ajax calls (I think), Valet+ becomes completely unresponsive. There is minor php-fpm usage when I open a page, but very short then nothing and eventually it times out with a 504 Gateway Timeout.
Very rarely it started working again after a few minutes without doing anything. Mostly I have to restart php and it works again. Sometimes it hangs again on the same Ajax call immediately after, but mostly the Ajax call is handled quickly and without problems after restarting php. Until I open some other pages, save something and try the Ajax call again, it breaks. This happens with a Drupal 8 project.
~/.valet/Log/nginx-error.log
:
2017/08/22 10:15:50 [error] 5708#0: *5648 upstream timed out (60: Operation timed out) while reading response header from upstream, client: 127.0.0.1, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/Users/sander/.valet/valet.sock", host: "project.dev", referrer: "http://project.dev/"
Nothing in ~/.valet/Log/php.log
I see this in /var/log/system.log
, but I think it's just a warning because php is always running:
Aug 22 10:07:14 nm2d-02345 com.apple.xpc.launchd[1] (homebrew.mxcl.php70): This service is defined to be constantly running and is inherently inefficient.
Does anyone have any idea which php/nginx settings I can try to solve this?
Hello,
I have just set up Valet+ (and WP-CLI Valet Command). Great time saver! I am able to create sites just fine.
There are a couple of problems though:
The documentation says that default mysql root
user's password is root
. But in my case, it doesn't work. Only empty/blank password works.
There are warnings and errors appearing when I run valet db ls
:
PHP Warning: mysqli::__construct(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /Users/sridharkatakam/.composer/vendor/weprovide/valet-plus/cli/Valet/Mysql.php on line 172
Warning: mysqli::__construct(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /Users/sridharkatakam/.composer/vendor/weprovide/valet-plus/cli/Valet/Mysql.php on line 172
Failed to connect to database
PHP Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, boolean given in /Users/sridharkatakam/.composer/vendor/weprovide/valet-plus/cli/Valet/Mysql.php on line 233
Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, boolean given in /Users/sridharkatakam/.composer/vendor/weprovide/valet-plus/cli/Valet/Mysql.php on line 233
PHP Fatal error: Uncaught Error: Call to a member function query() on boolean in /Users/sridharkatakam/.composer/vendor/weprovide/valet-plus/cli/Valet/Mysql.php:234
Stack trace:
#0 /Users/sridharkatakam/.composer/vendor/weprovide/valet-plus/cli/Valet/Mysql.php(256): Valet\Mysql->getDatabases()
#1 /Users/sridharkatakam/.composer/vendor/weprovide/valet-plus/cli/includes/facades.php(28): Valet\Mysql->listDatabases()
#2 /Users/sridharkatakam/.composer/vendor/weprovide/valet-plus/cli/valet.php(428): Facade::__callStatic('listDatabases', Array)
#3 [internal function]: Silly\Application->{closure}(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput), 'ls', NULL, NULL)
#4 /Users/sridharkatakam/.composer/vendor/php-di/invoker/src/Invoker.php(82): call_user_func_array(Object(Closure), Array)
#5 /Users/sridharkatakam/.composer/vendor/mnapoli/silly/src/Application.php(95): Invoker\Invoker->call(Object(Closure), Array)
#6 [internal function]: Silly\Application->Silly\{closure}(Object(Sy in /Users/sridharkatakam/.composer/vendor/weprovide/valet-plus/cli/Valet/Mysql.php on line 234
Fatal error: Uncaught Error: Call to a member function query() on boolean in /Users/sridharkatakam/.composer/vendor/weprovide/valet-plus/cli/Valet/Mysql.php:234
Stack trace:
#0 /Users/sridharkatakam/.composer/vendor/weprovide/valet-plus/cli/Valet/Mysql.php(256): Valet\Mysql->getDatabases()
#1 /Users/sridharkatakam/.composer/vendor/weprovide/valet-plus/cli/includes/facades.php(28): Valet\Mysql->listDatabases()
#2 /Users/sridharkatakam/.composer/vendor/weprovide/valet-plus/cli/valet.php(428): Facade::__callStatic('listDatabases', Array)
#3 [internal function]: Silly\Application->{closure}(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput), 'ls', NULL, NULL)
#4 /Users/sridharkatakam/.composer/vendor/php-di/invoker/src/Invoker.php(82): call_user_func_array(Object(Closure), Array)
#5 /Users/sridharkatakam/.composer/vendor/mnapoli/silly/src/Application.php(95): Invoker\Invoker->call(Object(Closure), Array)
#6 [internal function]: Silly\Application->Silly\{closure}(Object(Sy in /Users/sridharkatakam/.composer/vendor/weprovide/valet-plus/cli/Valet/Mysql.php on line 234
Could this be because I did not install Composer using Homebrew? I already had Composer installed globally using https://getcomposer.org/doc/00-intro.md#globally prior to installing Valet+. So I skipped that step during Valet+ installation.
Any help is appreciated.
I am using mainwp to locally to connect to a host on the same machine, and when I do I get the following notice:
Server self connect | The HTTP response test get an error "cURL error 51: SSL: certificate verification failed (result: 5)"Not expected HTTP response body:
I have removed and resured the local hosts and still get the same issue. I went into Keychain access and remove all of the certificates and started again. Still no joy.
Not sure if this is my configuration but when I ran composer global update
, Valet+ was not updated.
In fact it was downgrading some dependencies as if it couldn't find Valet+. I saw the Valet+ require in ~/.composer/composer.json
with version "^0.2.3"
.
Als running composer global show
shows:
weprovide/valet-plus 0.2.3 Blazing fast macOS PHP development environment
I had to use composer global require weprovide/valet-plus:0.4.0
to install the latest version.
Getting already declared error for Redis when installing Valet-plus valet install
:
PHP Fatal error: Cannot declare class Redis, because the name is already in use in /Users/aek/.composer/vendor/weprovide/valet-plus/cli/includes/facades.php on line 35
PHP Stack trace:
PHP 1. {main}() /Users/aek/.composer/vendor/weprovide/valet-plus/cli/valet.php:0
PHP 2. require() /Users/aek/.composer/vendor/weprovide/valet-plus/cli/valet.php:10
PHP 3. ComposerAutoloaderInit41a7cc1ebcee16e4d84f7173b844eaac::getLoader() /Users/aek/.composer/vendor/autoload.php:7
PHP 4. composerRequire41a7cc1ebcee16e4d84f7173b844eaac() /Users/aek/.composer/vendor/composer/autoload_real.php:56
Class Redis is already declared in cli/Valet/Redis.php so...
I have cleared cache and removed all global composer requirement except for valet-plus.
It should automatically start. At the moment you have to run brew services start mailhog
Automatic installation of elasticsearch
Sander-mc:m2_22rc sander$ valet db create
Error creating database
I got this error thinking it was something wrong with the directory name, until I read the documentation and figured out the database name is based on the git repo name, and there was none. Maybe update the error message to read: 'Error creating database, no git repo found.' ?
Or even have a fallback to the directory name if there is no git yet.
I can not set a different password for valet to use - I looked into .valet
but did not find any hint about where valet might be looking for passwords. Please add some info in the docs about how to change the used password.
Please note: I know how to change the mysql / mariadb root password. I do not know where to set the mysql password valet uses.
Thank you very much for your attention!
Not sure if it's my local setup but I can't seem to get a Drupal 7 site working, any idea?
Also drush cc all
is giving me:
No Drupal site found, only 'drush' cache was cleared.
Even though I have a settings.php with (I think) the right db settings:
$databases['default']['default'] = array(
'driver' => 'mysql',
'database' => 'project',
'username' => 'root',
'password' => 'root',
'host' => 'localhost',
'prefix' => '',
'collation' => 'utf8_general_ci',
);
Open closest git repository in tower2
I'm trying to export a Magento2 DB via SequelPro, but the export always stops around table number 32-35 because the MySQL server just stops working. After running a valet restart
the server is back online, but restarting the export breaks it again.
This is rather a pressing issue, because I use MySQL exports frequently via SequelPro
I've installed a Magento 1 webshop and everything works except when I go to the admin forget password form (http://project.dev/index.php/admin/index/forgotpassword/). It's trying to dynamically load javascript files through the following URL:
http://project.dev/js/index.php/x.js?f=prototype/prototype.js,prototype/validation.js,mage/adminhtml/events.js,mage/adminhtml/form.js,scriptaculous/effects.js
but this gives a 404.
index.php has logic to deal with the /x.js but I think Valet+ is trying to read index.php as a directory or something.
Any idea's ?
For example: can I set one domain / folder to run on PHP7.0 and the other on PHP7.1?
I understand that this can be quite challenging for the CLI, but is it possible to provide a preferred version number that is used with Nginx?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.