Git
on the serversudo apt install git
Installs Nginx serversudo apt install nginx
Installs MySQL Serversudo apt install mysql-server
Installs php-fpm and php-mysqlsudo apt install php-fpm php-mysql
Installs additional necessary packages for PHPsudo apt install php-pdo php-common php-dom php-mbstring php-gd php-json php-soap php-xml php-cli php-ldap php-zip
backup.sql
backup file of some_db
database using some_user
MySQL user.
The database is located at 34.mysql.servage.net
server.mysqldump -h 34.mysql.servage.net -u some_user -p some_db > backup.sql
Creates backup.sql
backup file of some_db
database with the same MySQL user but without -h
flag.
If the database is located on the same server (localhost) -h
flag is not necessary to specifymysqldump -u some_user -p some_db > backup.sql
If we want to include all the routines (procedures, functions), then we need to use flag -R
mysqldump -u some_user -p some_db -R > backup.sql
If we want to export only one or several tables, then we should list tables after database namemysqldump -u root -p sdtokens sdt_prices another_table > sdt_prices.sql
After running the command, we will be required to enter password of the some_user
mysql user.
After that, MySQL will create backup.sql
file on the same locationfunc_get_args
and func_num_args
functions.
func_get_args
Gets function arguments
func_num_args
Gets amount of function arguments.
class myClass {
public function __construct() {
$get_arguments = func_get_args();
$number_of_arguments = func_num_args();
if (method_exists($this, $method_name = '__construct'.$number_of_arguments)) {
call_user_func_array(array($this, $method_name), $get_arguments);
}
}
public function __construct1($argument1) {
echo 'constructor with 1 parameter ' . $argument1 . "\n";
}
public function __construct2($argument1, $argument2) {
echo 'constructor with 2 parameter ' . $argument1 . ' ' . $argument2 . "\n";
}
public function __construct3($argument1, $argument2, $argument3) {
echo 'constructor with 3 parameter ' . $argument1 . ' ' . $argument2 . ' ' . $argument3 . "\n";
}
}
$object1 = new myClass('BUET');
$object2 = new myClass('BUET', 'is');
$object3 = new myClass('BUET', 'is', 'Best.');
sql.zip
file to the location /var/www/
of use.ge
server using root
user scp sql.zip root@use.ge:/var/www/
We can use full path for the file that we want to movescp /var/www/sql.zip root@use.ge:/var/www/
We can also use an IP address (instead of domain name) to specify the server that we want the file to move toscp /var/www/sql.zip root@167.172.187.21:/var/www/
After the command execution the user is required to enter password of root
user