centos7.7 php7.3 the installation environment and the composer detailed steps lnmp

1. Update the source
  yum Update
2. install nginx
  yum install nginx
3. Start nginx
  Service Start nginx
4. visit http: // your ip

5. Installation mysql:

Mysql installation source yum localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
installation: yum install mysql mysql-server
start: /etc/init.d/mysqld start or service mysqld restart

Reset the password: mysql -u root -p
chance of error Can not connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
reasons: Permissions problems
to solve: sudo chown -R root: root / var / lib / mysql (two root can change the owner, but need to be consistent)
to restart the service
service mysqld restart

Landing mysql
mysql -u root -p // press enter directly can visit, just installed mysql is no password
to modify mysql password
use mysql;

  Low modified version: update user set password = password ( 'your database password') where user = 'root';

  High modified version: update user set authentication_string = password ( 'your database password') where user = 'root';

exit;
restart service mysqld restart
allow remote access
by adding the following command line, if necessary, add the ability to remotely connect to root. Link password is "root" (without the quotation marks)

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
FLUSH PRIVILEGES;

6. Install PHP
  yum install PHP PHP-devel //php5.6 version
  if you want to install 7.3
  first install EPEL source
  1.yum install epel-release // install EPEL source
  2.yum install http://rpms.remirepo.net/ enterprise / remi-release-7.rpm // source mounted REMI
  3.yum install -y php73-php-fpm php73-php-cli php73-php-bcmath php73-php-gd php73-php-json php73-php-mbstring php73-php-mcrypt php73-php -mysqlnd php73-php-opcache php73-php-pdo php73-php-pecl-crypto php73-php-pecl-mcrypt php73-php-pecl-geoip php73-php-recode php73-php- snmp php73-php-soap php73- php-xml

  4.PHP installation directory / etc / opt / remi / php73 / php.ini which are
    found inside php.ini fix_pathinfo modified to 0, but can not see phpinfo ();

    Operation
    systemctl restart php73-php-fpm # restart
    systemctl start php73-php-fpm # Start
    systemctl stop php73-php-fpm # Close
    systemctl status php73-php-fpm # Check Status

7. Finally updated to facilitate future updates yum update php extension with resources

8. Install composer
  curl -sS https://getcomposer.org/installer | php73
  mv composer.phar / usr / local / bin / composer
  such input composer will get an error: / usr / bin / env: php: No such file or directory
  Workaround
  cd usr / bin
  cp php73 PHP
  like in the input composer

  Change the mirror to Ali cloud: composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

9. Installation Git
  yum the install Git -Y

10. Download Laravel frame
  composer create-project --prefer-dist laravel / laravel item name "* 6"

  composer create-project --prefer-dist laravel/laravel laravelxs "6.*"

  Modify composer file. composer.json

  "github.com": "generated on the git token"

 

Guess you like

Origin www.cnblogs.com/cocoqi/p/12546557.html