The alias command is used to set the name of the directive. We can use this command to simplify some of the longer commands. When using alias, the user must use single quotes ' to cause the original command to prevent special characters from causing an error
Today encountered a problem, I use the Yum way to install the PHP7 environment, including Nginx, PHP-FPM and so on, using the Remi Source, installation was successful, but the PHP Global environment variable is PHP70, that is, in the terminal originally command PHP is available, it must now be PHP It's 70.
directive: Alias
Set an alias for a directive
Syntax: # alias name= ' command line '
Parameters:
-P: Print aliases that appear (unique parameters)
If you do not add any arguments, list all current alias settings
Example: ermao@lost-desktop:~$ alias
Alias egrep= ' Egrep--color=auto '
Alias fgrep= ' Fgrep--color=auto '
Alias grep= ' grep--color=auto '
Alias l= ' LS-CF '
Alias La= ' Ls-a '
Alias Ll= ' Ls-alf '
Alias ls= ' ls--color=auto '
Description: User can use alias, custom instruction aliases. If you only enter an alias, you can list all current alias settings. The alias's effect only extends to the operation of the login. To automatically set an alias every time you log in, you can set an alias for the directive in/etc/profile or your own ~/.BASHRC.
Because you do not compile the installation, the Yum install installation of PHP, the way to change the file is not very good, here is useful to Linux command alias, execute the alias command:
[Root@iz94r80gdghz ~]# alias php= ' Php70 '
[Root@iz94r80gdghz ~]# PHP
So the PHP command can be used.
Another problem encountered, the use of composer, composer installation is correct, separate PHP composer.phar no problem, set it as a global call, in other directory input composer command, prompted the following error:
[Root@iz94r80gdghz bin]# composer
/usr/bin/env:php: No file or directory
This should be because composer default that PHP is installed in the/usr/local/bin/php path, but this Remi source of PHP is not the case, but there is a way to link the directory through the form of soft links.
[Root@iz94r80gdghz bin]# ln-s/usr/bin/php70/usr/local/bin/php
[Root@iz94r80gdghz bin]# composer
In this way, it can be used normally. This is also the use of Remi Source to install PHP encountered pits, or own hands-on compile installation more reliable.