Monday, 27 July 2020
How to install chrome in ubuntu
Saturday, 25 July 2020
how to install xdebug and config with phpstorm in Ubuntu
- config xdebug
配置phpstorm
- 配置
以下操作以图片形式展示
选择你自己的php版本
name随便填,自己认得就行,host及端口需要与xdebug.ini中配置的相同,debuger选择xdebug
debug端口也需要与xdebug.ini中配置的相同
information栏目全部展示为绿色的勾则表示phpstorm配置成功
安装浏览器xdebug扩展
如果可以翻墙直接去谷歌扩展商店下载安装
然后鼠标左击灰色的虫子,将选项由disable变为debug,然后虫子就变为了绿色,这就代表它已经开始工作了,不过你不需要总是打开它,在你调试的域名下将其开启即可。
在phpstorm针对你的项目进行配置
点击phpstorm菜单栏的RUN
在你想打断点的地方点击一下左边的行号一栏,然后将菜单栏的电话由变为两头都是绿色,然后在浏览器中运行你想调试的页面
返回phpstorm点击F9跳到你打断点的地方,F9为跳到下一个断点,F7为下一步,将鼠标移动到下面的选项上即可看到相应的快捷键
调试得到你想要的结果了点击停止即可结束,记得关闭电话,不然会处于调试状态。当你需要再次调试再去打开它。
作者:wenco
链接:https://juejin.im/post/5ba5cba6e51d450e6d00e69f
来源:掘金
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
delete file and folder from github
Friday, 24 July 2020
git push: permission denied (public key)
cd ~/.ssh
ssh-keygen2) cat ~/.ssh/id_rsa.pub3) Copy the key, including the "ssh-rsa" but excluding your computer name at the end
4) Go to https://github.com/settings/ssh
5) Add your SSH key
php不输出错误信息解决办法
Thursday, 23 July 2020
ubuntu文件夹建立软链接方法
解决virtualbox共享文件夹没有访问权限的问题
https://www.cnblogs.com/xia-weiwen/p/8215350.html
Virtualbox是一款免费试用的虚拟机软件。基本功能完全可替代需要购买或crack的VMware。
在Windows主机上用Virtualbox搭建Linux虚拟机,虚拟机和主机之间传递文件最方便的方法就是共享文件夹。
假设将Windows下的share文件夹作为共享文件夹。设置好共享文件夹之后,进入虚拟机,共享文件夹的地址是/media/sf_share。
但是进入该文件夹时,会发现共享文件夹无法访问,系统提示的原因是权限不足(Permission denied)。
在虚拟机下查看共享文件夹的属性,发现该目录的所有者是root,所属组是vboxsf。而一般而言我们登录的用户和所属组都是<user>(你的用户名),所以确实没有权限。

而共享文件夹的所有者和所属组是不能修改的。(不信的话可以切到root用户试一下 😛 )
那么解决权限不足问题的方法就是将自己登录的用户,添加到vboxsf组中。
具体做法是:
(1)执行如下指令:
sudo usermod -aG vboxsf $(whoami)
这条指令的含义是:
usermod -aG <group> <user>
将用户<user>加入到(追加到)组<group>中,其中选项[-aG]是追加到组的意思。
(2)重启虚拟机系统
然后进入系统,共享文件夹已经可以正常使用。
Enjoy!
Can’t log into phpMyAdmin: mysqli_real_connect(): (HY000/1698): Access denied for user ‘root’@’localhost’
https://devanswers.co/phpmyadmin-access-denied-for-user-root-localhost/
Introduction
This error may be due to one of the following reasons:
- Due to changes in MySQL 5.7 / MySQL 8+, you cannot log into phpMyAdmin using the root account.
See section: MySQL 5.7 / MySQL 8+
- You have forgotten your root password.
See article: How To Reset the MySQL Root Password
- The
hostvalue for root is preventing access via phpMyAdmin.
See article: Understanding MySQL Users and Hosts
- You are trying to log into phpMyAdmin using an account other than root but are getting an error “Access denied for user (using password: YES)”.
See article: MySQL Rejecting Correct Password
- If using MySQL 5.6 and below
See section: MySQL 5.6 and below
MySQL 5.7 / MySQL 8+
In MySQL 5.7 (released Oct 2015) and MySQL 8, the root MySQL user is set to authenticate using the auth_socket or caching_sha2_password plugin rather than with mysql_native_password. This will prevent programs like phpMyAdmin from logging in with the root account.
You can either create a new MySQL superuser just for phpMyAdmin or you can try changing the authentication method for root. Personally I would recommend creating a new superuser as it’s not a good idea to allow the root account to be accessed via phpMyAdmin if accessible over the internet.
Choose from one of the two following methods:
Method 1: Create a New Superuser for phpMyAdmin
In terminal, log in to MySQL as root. You may have created a root password when you installed MySQL for the first time or the password could be blank. If you have forgotten your root password, you can always Reset the MySQL Root Password.
sudo mysql -p -u rootNow add a new MySQL user with the username of your choice. In this example we are calling it pmauser. Make sure to replace password_here with your own. You can generate a strong password here.
The command below will create a new user called pmauser (call this what you like) which can access the MySQL server from localhost with the password password_here.
CREATE USER 'pmauser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password_here';Now we will grant superuser privilege to our new user pmauser.
GRANT ALL PRIVILEGES ON *.* TO 'pmauser'@'localhost';You should now be able to access phpMyAdmin using this new user account.
If you are getting an error for this new user “Access denied for user (using password: YES)”, please read this article.
If you are getting an error “Failed to set session cookie. Maybe you are using HTTP instead of HTTPS”, please read this article.
Method 2: Change root Authentication Method
In order to log into phpMyAdmin as your root MySQL user, you will need to switch its authentication method from auth_socket or caching_sha2_password to mysql_native_password.
Open up the MySQL prompt from your terminal:
sudo mysqlRun the following query.
SELECT user,plugin,host FROM mysql.user WHERE user = 'root';Output:
+------+-------------+-----------+
| user | plugin | host |
+------+-------------+-----------+
| root | auth_socket | localhost |
+------+-------------+-----------+
1 row in set (0.00 sec)
Above we can see that the plugin for the root account is set to auth_socket. This may also say caching_sha2_password. You need to change this to mysql_native_password. Also, the host value should be set to localhost or %. If it’s set to anything else, you may not be able to log into phpMyAdmin with root. See: Understanding MySQL Users and Hosts
Run the following query to change the plugin value to mysql_native_password. Make sure to replace enter_password_here with your own. Click here if you need to generate a new password.
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'enter_password_here';Flush privileges.
FLUSH PRIVILEGES;You should now be able to log into phpMyAdmin using your root account.
Wednesday, 22 July 2020
How to Enable SSH on Ubuntu 18.04
https://linuxize.com/post/how-to-enable-ssh-on-ubuntu-18-04/
Secure Shell (SSH) is a cryptographic network protocol used for a secure connection between a client and a server.
In this tutorial, we’ll show you how to enable SSH on an Ubuntu Desktop machine. Enabling SSH will allow you to remotely connect to your Ubuntu machine and securely transfer files or perform administrative tasks.
Prerequisites
Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges .
Enabling SSH on Ubuntu
The SSH server is not installed by default on Ubuntu desktop systems but it can be easily installed from the standard Ubuntu repositories.
To install and enable SSH on your Ubuntu system complete the following steps:
Open your terminal either by using the
Ctrl+Alt+Tkeyboard shortcut or by clicking on the terminal icon and install theopenssh-serverpackage by typing:sudo apt updatesudo apt install openssh-serverEnter the password when prompted and enter
Yto continue with the installation.
Once the installation is completed, the SSH service will start automatically. To verify that the installation was successful and SSH service is running type the following command which will print the SSH server status:
sudo systemctl status sshYou should see something like
Active: active (running):
Press
qto get back to the command line prompt.Ubuntu comes with a firewall configuration tool called UFW. If the firewall is enabled on your system, make sure to open the SSH port:
sudo ufw allow ssh
Now that SSH is installed and running on your Ubuntu system you can connect to it via SSH from any remote machine. Linux and macOS systems have SSH clients installed by default. If you want to connect from a Windows machine then you can use an SSH client such as PuTTY .
Connecting to SSH Over LAN
To connect to your Ubuntu machine over LAN you only need to enter the following command:
ssh username@ip_addressusername with the actual user name and ip_address with the IP Address of the Ubuntu machine where you installed SSH.If you don’t know your IP address you can easily find it using the ip command :
ip a
As you can see from the output, the system IP address is 192.168.121.111.
Once you’ve found the IP address, login to remote machine by running the following ssh command:
ssh linuxize@192.168.121.111When you connect through SSH for the first time, you will see a message looking something like this:
The authenticity of host '192.168.121.111 (192.168.121.111)' can't be established.
ECDSA key fingerprint is SHA256:Vybt22mVXuNuB5unE++yowF7lgA/9/2bLSiO3qmYWBY.
Are you sure you want to continue connecting (yes/no)?
Type yes and you’ll be prompted to enter your password.
Warning: Permanently added '192.168.121.111' (ECDSA) to the list of known hosts.
linuxize@192.168.121.111's password:
Once you enter the password you will be greeted with a message similar to the one below.
Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-33-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
...
You are now logged in to your Ubuntu machine.
Connecting to SSH Over Internet
To connect to your Ubuntu machine over the Internet you will need to know your public IP Address and to configure your router to accept data on port 22 and send it to the Ubuntu machine where the SSH is running.
To determine the public IP address of the machine you’re trying to SSH to, simply visit the following URL: https://api.ipify.org .
When it comes to setting up port forwarding each router has a different way to setup port forwarding. You should consult your router documentation about how to set up port forwarding. In short, you need to enter the port number where requests will be made (Default SSH port is 22) and the private IP address you found earlier (using the ip a command) of the machine where the SSH is running.
Once you’ve found the IP address, and configured your router you can log in by typing:
ssh username@public_ip_addressIf you are exposing your machine to the Internet it is a good idea to implement some security measures. The most basic one is to configure your router to accept SSH traffic on a non-standard port and to forward it to port 22 on the machine running the SSH service.
You can also set up an SSH key-based authentication and connect to your Ubuntu machine without entering a password.
Disabling SSH on Ubuntu
If for some reason you want to disable SSH on your Ubuntu machine you can simply stop the SSH service by running:
sudo systemctl stop sshTo start it again run:
sudo systemctl start sshTo disable the SSH service to start during system boot run:
sudo systemctl disable sshTo enable it again type:
sudo systemctl enable sshConclusion
You have learned how to install and enable SSH on your Ubuntu 18.04. You can now login to your machine and perform common sysadmin tasks through the command prompt.
By default, SSH listens on port 22. Changing the default SSH port adds an extra layer of security to your server by reducing the risk of automated attacks.
If you are managing multiple systems, you can simplify your workflow by defining all of your connections in the SSH config file .
For more information, about how to configure your SSH server read the Ubuntu’s SSH/OpenSSH/Configuring guide and the official SSH manual page.
If you have any questions, please leave a comment below.
