$ sudo update-alternatives --config php # and then pick a number from the list
includes: | |
- ./vendor/nunomaduro/larastan/extension.neon | |
parameters: | |
paths: | |
- app/ | |
# Level 9 is the highest level | |
level: 5 |
/**
* Filter a value in a way that it always must be prepended with either http:// or https://.
* Useful when we must be sure a string will be treated as a URL.
* @param string $string Value to filter
* @return string Value prefixed with http:// or https://
*/
function httpize_string(string $string) : string
{
return preg_match('{https?://}', $string) ? $string : 'http://' . $string;
Composer is not supposed to be ran as sudo / root, but at the same using the global
(or -g
) argument might give us permission errors.
To fix this, we need to change ownership of the ~/.composer
directory to the current user:
$ sudo chown -R $USER:$USER ~/.composer
I’ll go step-by-step on how to create a virtual host in the XAMPP environment.
As we know, the default http://localhost points to /opt/lampp/htdocs
as the root directory. The desired result is to be able to visit http://examplevhost.local, with the root directory being /opt/lampp/htdocs/examplevhost
.
Note: The steps below are done on Ubuntu 16.04, but they should also work on most other Linux distributions (Debian, Mint, Arch).
Note: I’ll assume that XAMPP is installed in
/opt/lampp/
. If it’s different on your setup, please read carefully and adjust accordingly.
Note: This should be done only once per XAMPP installation. If you want to add another virtual host later you can skip to the next step.
After installing XAMPP on Linux, the htdocs folder (default: /opt/lampp/htdocs
) can only be written to by root. Although this is normal since the installer has been executed as root, we would still like to be able to create, edit, and remove content from htdocs within our file manager or text editor, without the need for sudo
.
Requirements:
XAMPP
installedsudo
Note: The steps below are done on Ubuntu 16.04, but they should also work on any other Linux distribution.
Warning: These permissions are safe on local environments such as XAMPP. I do not recommend using this for production.
Install the libqt5libqgtk2
package:
$ sudo apt-get install libqt5libqgtk2
$ sudo ln -s /usr/bin/nodejs /usr/bin/node