-
Notifications
You must be signed in to change notification settings - Fork 1
/
install_laravel_ubuntu.txt
114 lines (84 loc) · 3.36 KB
/
install_laravel_ubuntu.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
1. Cài đặt apache
$ sudo apt-get update
$ sudo apt-get install apache2
2. Cài đặt MySQL
$ sudo apt-get update
$ sudo apt-get install mysql-server
-------------Ubuntu > 16----------------------
$ mysql -u <user> - h <host> -p
$ sudo mysql ---> to access mysql server
3. Cài đặt server side script
$ sudo apt-get update
$ sudo apt-get install software-properties-common
or: sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:ondrej/php
or: LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
$ sudo apt-get update
$ sudo apt-get install php
$ sudo apt-get install php-fpm php-pear php-curl php-dev php-gd php-mbstring php-zip php-mysql php-xml php-cli
// ==> php-pear -> no version
This command will install additional packages:
`libapache2-mod-php7.2
libargon2-0
libsodium23
libssl1.1
php7.2-cli
php7.2-common
php7.2-json
php7.2-opcache
php7.2-readline`
- For Debian:
sudo apt install ca-certificates apt-transport-https
wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add -
echo "deb https://packages.sury.org/php/ stretch main" | sudo tee /etc/apt/sources.list.d/php.list
cd /etc/apt/sources.list.d/
sudo mv ondrej-ubuntu* /tmp
sudo apt -y update
sudo apt install php7.3
4. Cài đặt composer
$ sudo apt-get update
$ sudo apt-get install curl git unzip
$ cd ~
$ curl -sS https://getcomposer.org/installer -o composer-setup.php
$ sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
5. Cài đặt phpmyadmin
$ sudo apt-get install phpmyadmin
Nếu sau khi cài đặt không chạy
$ sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
$ sudo a2enconf phpmyadmin
$ sudo service apache2 reload
- Fix `./libraries/sql.lib.php#601`:
+ go to: /usr/share/phpmyadmin/libraries/sql.lib.php
|| (count($analyzed_sql_results['select_expr'] == 1)
to:
|| (count($analyzed_sql_results['select_expr']) == 1
- Fix user root can't login or Install MySQL Server missing input password step
password default if doesn't input: `password`
open terminal: sudo dpkg-reconfigure phpmyadmin
- Update password for `root` user:
+ service mysql stop
+ mysqld_safe --skip-grant-tables &
+ sudo mysql -u root -p
+ > use mysql;
+ > select * from user;
+ > truncate table user;
+ > flush privileges;
+ > grant all privileges on *.* to root@localhost identified by 'YourNewPassword' with grant option;
+ > flush privileges;
+ > select host, user from user;
+ > quit;
+ > kill -KILL [PID of mysqld_safe]
+ > kill -KILL [PID of mysqld]
+ > service mysql start
+ > mysql -u root -p
Link: https://stackoverflow.com/questions/2995054/access-denied-for-user-rootlocalhost-using-passwordno
Link chi tiết fix lỗi:
https://askubuntu.com/questions/55280/phpmyadmin-is-not-working-after-i-installed-it
6. Switch PHP version:
sudo update-alternatives --config php
7. Downgrade composer version on Windows:
$ composer self-update --1
Tài liệu tham khảo:
Cài đặt MySQL: https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-16-04
Cài đặt PHP: https://thishosting.rocks/install-php-on-ubuntu/
Cài đặt composer: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-composer-on-ubuntu-16-04