Laravel valet linked php error - laravel-valet

I got an error.
$ valet install
[DomainException]
Unable to determine linked PHP.
install
'which' command returns:
$ which php
/usr/local/Cellar/php70/7.0.6/bin/php

I used Homebrew to instal php7.1 , So I ran this command in terminal
ln -s /usr/local/opt/php71/bin/php /usr/local/bin/php
and everything is done.

if your PHP version 7.x and valet > 2.0.8 update valet
valet stop
valet uninstall
brew install php
composer global require laravel/valet
then valet install

Homebrew creates (or attempts to create) symlinks in /usr/local/bin.
Start by running the following to attempt to create a link.
brew link php70
It'll give you information as to whether or not it was successful. Occasionally permissions are problematic and you can resolve this with
sudo chown -R `whoami`:admin /usr/local/bin
Then try running the brew link command again.
Alternately brew link may give you instructions, or you can use brew doctor to get a report on any problems which exist with your Homebrew installation.
When it's set up properly after running ls -la /usr/local/bin | grep bin/php$ you should see something similar to
lrwxr-xr-x 1 YOURUSER admin 29 10 May 21:40 php -> /usr/local/Cellar/php70/7.0.6/bin/php

I was going to update Laravel Valet from version 1.* to 2 and ran same error like this
Unable to determine linked PHP
The solution was to run
composer global update
before I ran
valet install

This happens when your brew php gets Updated.
If you do brew install php this will work but will install php 7.2 by default.
If you want php#7.1 you have to do brew install php#7.1 this will install php7.1 and now when you restart valet valet restart you might get an error. Unable to determine linked PHP.
To make this work with php7.1 you have make brew link
brew link php71
you may have this error
Warning: php#7.1 is keg-only and must be linked with
to fix this
brew link --force php71
now valet should work on php7.1

I tried all of the suggestions here—and several from elsewhere—before I hit on the solution. This applies to PHP 7.2 (no guarantee for other versions). If you are using the original Larvel Valet, open the file:
~/.composer/vendor/laravel/valet/cli/Valet/Brew.php
...or, if you're using Valet+
~/.composer/vendor/weprovide/valet-plus/cli/Valet/Brew.php
Locate the supportedPhpVersions method. In some versions, it will return an array right in the method:
return ['php72', 'php71', 'php70', 'php56'];
Change this to:
return ['7.2', 'php72', 'php71', 'php70', 'php56'];
In other cases, it'll reference const SUPPORTED_PHP_VERSIONS, and the change will be similar.
Save the file, restart valet, and Bob's your uncle!

Related

Unable to install ruby using RVM on WSL 2 and Ubuntu

I have a windows 10 machine with WSL 2 and Ubuntu 20.x installed. I installed RVM on Ubuntu. RVM seems to be installed fine, but when I try and install a ruby rvm install 3.1.2 I get the error mkdir: cannot create directory ‘/usr/share/rvm/log/1658255479_ruby-3.1.2’: Permission denied Anything special I should be doing on WSL 2 to make this work?
I can reproduce this exact error if I try rvm install 3.1.2 without having added my user to the rvm group per the installation instructions. Is it possible that you missed this step?
sudo usermod -a -G rvm $USER
After adding the user, then exiting the shell/WSL and restarting, rvm install 3.1.2 (almost) worked as expected. It appears there's a slight bug where it asks for the sudo password on the same line as a previous Updating system.. line, so it's easy to miss, but this is recoverable.

not able to install anything because of brew no such file or directory error

I am trying to install do brew install python3 on my mac but i keep getting the following errors:
this is the first error:
No such file or directory # dir_chdir - /usr/local/Cellar
then a bit later i get this error:
An exception occurred within a child process:
Errno::EPERM: Operation not permitted # dir_s_mkdir - /usr/local/Cellar
I have ran brew update then brew doctor the brew cleanup but keep getting the error.
I have also checked to see if xcode is up-to-date but according to the appstore all my apps are up-to-date.
How do i fix this problem?
PS i also get these errors when trying to install other packages from brew.
Try uninstalling Homebrew and then re-installing solved issue for me.
Uninstall Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
Re-install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Performed in MacOS Mojave (10.14.4)
Happened to me when uninstalling Laravel Valet.
Fixed by running: brew doctor, then brew cleanup after.
After that - brew install php worked just fine.
I experienced a similar error with a different package - brew install llvm.
Uninstalling homebrew and reinstalling led to more catastrophic issues that lasted for hours before I had to reach for my backup drive and restore everything.
What eventually worked was just creating the missing directory and everything worked.
So in this case:
sudo mkdir /usr/local/Cellar/dir_chdir
should solve the issue without too much hustle.
It worked for me after running below commands
sudo mkdir /usr/local/Cellar/dir_chdir
sudo chown -R $(whoami) /usr/local/Cellar
chmod u+w /usr/local/Cellar
I had this problem as well - it was partly coming from brew being installed under a different user on my mac I had set up for a past project. I had to follow the uninstall instructions (found in the homebrew github) with a little bit of sudo help and it cleared up the issue. Was able to install and properly run packages after.
For ubuntu just go to the location which u are getting error. Then open the contained file using a suitable application. In my case, it is getting as follows in the image view.
In this case, the error is showing in 36's lines.
yes. There is no location such as. I have to find out the location which contains brew. It was in /home/linuxbrew/.linuxbrew//bin/brew shellenv
So update your .profile file as in the brew file contains location as follows image shown.
uninstall brew :
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
and again reinstall brew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
executed this same as it is on your terminal, it will really work.

mix local.hex fails from SSL after updating Erlang

I was prompted to update Erlang on my machine and I did. Then when I restarted my server I was prompted to update using mix local.hex.
When i did this it gave me the following error.
mix local.hex --force didn't work either.
I eventually found out that I installed erlang originally without brew originally which is where the prompt came from. After I updated it, it caused an issue with mix local.hex.
I manually removed the folder /usr/local/lib/erlang and all erlang on my machine. I installed erlang using 'brew install erlang' and then ran 'brew link erlang'
This originally didn't work because I didn't have permission but then I ran the following to get permission.
sudo chown -R $(whoami) /usr/local/lib
After that 'brew link erlang' worked and I was able to run 'mix local.hex' like normal.

Not able to install mod_perl module on the server

In my site I am getting an error : an error occurred while processing this directive
It was working fine before moving to the new server. So when I checked I found that mod_perl module is missing. So I tried to install it by downloading the module to the server and then tried to run using Perl Makefile.pl but it was asking for apache src and I was not able to find it. I can see /usr/bin/apache/ folder but no source file inside the folder.
So I tried to install the module from Cpanel but I got the following error:
The C compiler is not functional and auto repair failed. Perl module installs require a working C compiler. Please repair the C compiler and try again.
Please let me know how to install it as I have tried most of the cases searching the net.
Thanks in advance
It's probably best to use your distro's packaging system to install mod_perl, especially, if apache is installed from a package too.
Yum based systems:
yum install mod_perl
Deb based systems
apt-get install mod_perl
you may need to enable the module using a2enmod
Mostly gcc is either corrupted or not present on your system. Please try to re/install gcc on your system
sudo apt-get update
sudo apt-get install build-essential
On Redhat:
yum update
yum install devtoolset-2-toolchain
It seems like a problem with your installation of gcc. You're using CloudLinux, so you should use yum to reinstall gcc.
$ sudo -i yum install gcc
But you don't need gcc if you install the pre-build packages.
$ sudo -i yum install mod_perl
Either way, you're going to need to get to grips with package installation for your system - and for that you're going to need root access.

RubyODBC Cannot allocate SQLHENV

I'm trying to connect to SQL Server on Ubuntu 9.04 using Ruby. I translated and followed all the steps outlined in getting OSX talking to SQL Server from here:
http://toolmantim.com/articles/getting_rails_talking_to_sqlserver_on_osx_via_odbc
Everything is working on the FreeTDS and unixODBC end. I can see and query the database using tsql.
When I try to access the database from Ruby using IRB I get the following error:
DBI::DatabaseError : INTERN (0) [RubyODBC] Cannot allocate SQLHENV
Has anyone run into this and what can I do to solve this?
I started getting this error when I upgraded to Ubuntu 9.10 (Karmic Koala). Your tip regarding installation order of the Ubuntu packages didn't work for me.
It seems the fix was to manually compile ruby-odbc.
wget http://www.ch-werner.de/rubyodbc/ruby-odbc-0.9997.tar.gz
tar xzvf ruby-odbc-0.9997.tar.gz
cd ruby-odbc-0.9997
ruby extconf.rb --with-dlopen
make
sudo make install
System
Ubuntu 9.10 64 bit
I had to specify the odbc directory in the rubyodbc install
wget http://www.ch-werner.de/rubyodbc/ruby-odbc-0.9997.tar.gz
tar xzvf ruby-odbc-0.9997.tar.gz
cd ruby-odbc-0.9997
ruby extconf.rb --with-odbc-dir=/usr/lib/odbc --disable-dlopen
make
sudo make install
I had the same problem.
But on Centos 5.5 not Ubuntu
Tried many forums/solutions with no joy.
The error message hints at a missing reference to unixODBC.
Which was setting using LD_LIBRARY_PATH variable.
Found another way to set path, by creating
/etc/ld.so.conf.d/odbc.conf.
add unixODBC location to file ie /usr/local/lib.
Run, sudo ldconfig.
Go fig that I actually got this working after submitting my question. What I ended up doing was uninstall libdbd-odbc-ruby and libdbi-ruby and then reinstalling them by installing libdbi-ruby first and then installing libdbd-odbc-ruby. I guess when I installed them before, something must of messed up.
BTW, following the instructions to recompile Ruby-ODBC on Ubuntu 9.10 (Karmic) required installation of either the libiodbc2-dev or the unixodbc-dev package. When using libiodbc2-dev, I got segmentation faults when my Ruby program tried:
connection.select_all('select top 15 * from log_device_healths')
..but no problem when using unixodbc-dev instead.
Tim Morgan's solution didn't work for me. However I was able to get things working by installing an older version of libodbc-ruby (0.9995) from here:
http://mirrors.kernel.org/ubuntu/pool/universe/libo/libodbc-ruby/libodbc-ruby1.8_0.9995-1_i386.deb
Additional details are available from Carsten Gehling's blog:
http://gehling.dk/2010/02/the-woes-of-libodbc-ruby1-8-and-debian-ubuntu/
Be careful though -- Ubuntu's Update Manager will happily "upgrade" this version of libodbc-ruby to the broken 0.9997-2. I accidentally overwrote the older version this way only to end up back here, trying to figure out how I fixed it last time.
Well, it seems my other answer stopped working for me. This thread helped me to solve the issue in another way, and I wanted to share it here.
sudo gem uninstall ruby-odbc
sudo rm /usr/local/lib/site_ruby/1.8/x86_64-linux/odbc.so
cd /tmp
wget http://mirrors.kernel.org/ubuntu/pool/universe/libo/libodbc-ruby/libodbc-ruby1.8_0.9995-1_amd64.deb
sudo dpkg -i libodbc-ruby1.8_0.9995-1_amd64.deb
If you're not on a 64-bit platform, you'll need to download a different Debian package.
Basically, what solves the problem is installing version 0.9995 of the ruby-odbc Ubuntu package.