-CentOS 7.2 64位装laravel环境----2020-2-8
yum update -y
。。。。。。。//很多
最后显示:
Replaced:
NetworkManager.x86_64 1:1.4.0-20.el7_3 grub2.x86_64 1:2.02-0.34.el7.centos grub2-tools.x86_64 1:2.02-0.34.el7.centos pygobject3-base.x86_64 0:3.14.0-3.el7 python-cheetah.x86_64 0:2.4.4-4.el7
python-markdown.noarch 0:2.4.1-2.el7 rdma.noarch 0:7.2_4.1_rc6-1.el7
Complete!
yum install epel-release
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-12 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================================================================================
Installing:
epel-release noarch 7-12 epel 15 k
Transaction Summary
=================================================================================================================================================================================================================
Install 1 Package
Total download size: 15 k
Installed size: 24 k
Is this ok [y/d/N]: y
Downloading packages:
epel-release-7-12.noarch.rpm | 15 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : epel-release-7-12.noarch 1/1
Verifying : epel-release-7-12.noarch 1/1
Installed:
epel-release.noarch 0:7-12
Complete!
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
Retrieving https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
warning: /var/tmp/rpm-tmp.Jm9vvw: Header V4 RSA/SHA1 Signature, key ID 62e74ca5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:webtatic-release-7-3 ################################# [100%]
yum install mariadb mariadb-server -y
Loaded plugins: fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* webtatic: uk.repo.webtatic.com
webtatic | 3.6 kB 00:00:00
(1/2): webtatic/x86_64/group_gz | 448 B 00:00:01
(2/2): webtatic/x86_64/primary_db | 248 kB 00:00:09
Resolving Dependencies
--> Running transaction check
---> Package mariadb.x86_64 1:5.5.64-1.el7 will be installed
---> Package mariadb-server.x86_64 1:5.5.64-1.el7 will be installed
--> Processing Dependency: perl-DBI for package: 1:mariadb-server-5.5.64-1.el7.x86_64
--> Processing Dependency: perl-DBD-MySQL for package: 1:mariadb-server-5.5.64-1.el7.x86_64
--> Processing Dependency: perl(Data::Dumper) for package: 1:mariadb-server-5.5.64-1.el7.x86_64
--> Processing Dependency: perl(DBI) for package: 1:mariadb-server-5.5.64-1.el7.x86_64
--> Running transaction check
---> Package perl-DBD-MySQL.x86_64 0:4.023-6.el7 will be installed
---> Package perl-DBI.x86_64 0:1.627-4.el7 will be installed
--> Processing Dependency: perl(RPC::PlServer) >= 0.2001 for package: perl-DBI-1.627-4.el7.x86_64
--> Processing Dependency: perl(RPC::PlClient) >= 0.2000 for package: perl-DBI-1.627-4.el7.x86_64
---> Package perl-Data-Dumper.x86_64 0:2.145-3.el7 will be installed
--> Running transaction check
---> Package perl-PlRPC.noarch 0:0.2020-14.el7 will be installed
--> Processing Dependency: perl(Net::Daemon) >= 0.13 for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Test) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Log) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Compress::Zlib) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Running transaction check
---> Package perl-IO-Compress.noarch 0:2.061-2.el7 will be installed
--> Processing Dependency: perl(Compress::Raw::Zlib) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
--> Processing Dependency: perl(Compress::Raw::Bzip2) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
---> Package perl-Net-Daemon.noarch 0:0.48-5.el7 will be installed
--> Running transaction check
---> Package perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 will be installed
---> Package perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================================================================================
Installing:
mariadb x86_64 1:5.5.64-1.el7 os 8.7 M
mariadb-server x86_64 1:5.5.64-1.el7 os 11 M
Installing for dependencies:
perl-Compress-Raw-Bzip2 x86_64 2.061-3.el7 os 32 k
perl-Compress-Raw-Zlib x86_64 1:2.061-4.el7 os 57 k
perl-DBD-MySQL x86_64 4.023-6.el7 os 140 k
perl-DBI x86_64 1.627-4.el7 os 802 k
perl-Data-Dumper x86_64 2.145-3.el7 os 47 k
perl-IO-Compress noarch 2.061-2.el7 os 260 k
perl-Net-Daemon noarch 0.48-5.el7 os 51 k
perl-PlRPC noarch 0.2020-14.el7 os 36 k
Transaction Summary
=================================================================================================================================================================================================================
Install 2 Packages (+8 Dependent packages)
Total download size: 21 M
Installed size: 110 M
Downloading packages:
(1/10): mariadb-5.5.64-1.el7.x86_64.rpm | 8.7 MB 00:00:04
(2/10): perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64.rpm | 32 kB 00:00:00
(3/10): perl-Compress-Raw-Zlib-2.061-4.el7.x86_64.rpm | 57 kB 00:00:00
(4/10): perl-DBD-MySQL-4.023-6.el7.x86_64.rpm | 140 kB 00:00:00
(5/10): perl-DBI-1.627-4.el7.x86_64.rpm | 802 kB 00:00:00
(6/10): mariadb-server-5.5.64-1.el7.x86_64.rpm | 11 MB 00:00:05
(7/10): perl-Data-Dumper-2.145-3.el7.x86_64.rpm | 47 kB 00:00:00
(8/10): perl-Net-Daemon-0.48-5.el7.noarch.rpm | 51 kB 00:00:00
(9/10): perl-IO-Compress-2.061-2.el7.noarch.rpm | 260 kB 00:00:00
(10/10): perl-PlRPC-0.2020-14.el7.noarch.rpm | 36 kB 00:00:00
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 3.9 MB/s | 21 MB 00:00:05
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : perl-Data-Dumper-2.145-3.el7.x86_64 1/10
Installing : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 2/10
Installing : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 3/10
Installing : perl-IO-Compress-2.061-2.el7.noarch 4/10
Installing : 1:mariadb-5.5.64-1.el7.x86_64 5/10
Installing : perl-Net-Daemon-0.48-5.el7.noarch 6/10
Installing : perl-PlRPC-0.2020-14.el7.noarch 7/10
Installing : perl-DBI-1.627-4.el7.x86_64 8/10
Installing : perl-DBD-MySQL-4.023-6.el7.x86_64 9/10
Installing : 1:mariadb-server-5.5.64-1.el7.x86_64 10/10
Verifying : perl-Net-Daemon-0.48-5.el7.noarch 1/10
Verifying : perl-Data-Dumper-2.145-3.el7.x86_64 2/10
Verifying : 1:mariadb-5.5.64-1.el7.x86_64 3/10
Verifying : perl-DBD-MySQL-4.023-6.el7.x86_64 4/10
Verifying : perl-IO-Compress-2.061-2.el7.noarch 5/10
Verifying : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 6/10
Verifying : 1:mariadb-server-5.5.64-1.el7.x86_64 7/10
Verifying : perl-DBI-1.627-4.el7.x86_64 8/10
Verifying : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 9/10
Verifying : perl-PlRPC-0.2020-14.el7.noarch 10/10
Installed:
mariadb.x86_64 1:5.5.64-1.el7 mariadb-server.x86_64 1:5.5.64-1.el7
Dependency Installed:
perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 perl-DBD-MySQL.x86_64 0:4.023-6.el7 perl-DBI.x86_64 0:1.627-4.el7 perl-Data-Dumper.x86_64 0:2.145-3.el7
perl-IO-Compress.noarch 0:2.061-2.el7 perl-Net-Daemon.noarch 0:0.48-5.el7 perl-PlRPC.noarch 0:0.2020-14.el7
Complete!
systemctl start mariadb.service
systemctl enable mariadb.service
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
接下来按确定继续
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n]
按y重设密码
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n]
按y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n]
按y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n]
按y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
yum install -y httpd
Loaded plugins: fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* webtatic: us-east.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-90.el7.centos will be installed
--> Processing Dependency: httpd-tools = 2.4.6-90.el7.centos for package: httpd-2.4.6-90.el7.centos.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-90.el7.centos.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-90.el7.centos.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-90.el7.centos.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.4.8-5.el7 will be installed
---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed
---> Package httpd-tools.x86_64 0:2.4.6-90.el7.centos will be installed
---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================================================================================
Installing:
httpd x86_64 2.4.6-90.el7.centos os 2.7 M
Installing for dependencies:
apr x86_64 1.4.8-5.el7 os 103 k
apr-util x86_64 1.5.2-6.el7 os 92 k
httpd-tools x86_64 2.4.6-90.el7.centos os 91 k
mailcap noarch 2.1.41-2.el7 os 31 k
Transaction Summary
=================================================================================================================================================================================================================
Install 1 Package (+4 Dependent packages)
Total download size: 3.0 M
Installed size: 10 M
Downloading packages:
(1/5): apr-util-1.5.2-6.el7.x86_64.rpm | 92 kB 00:00:00
(2/5): httpd-2.4.6-90.el7.centos.x86_64.rpm | 2.7 MB 00:00:00
(3/5): httpd-tools-2.4.6-90.el7.centos.x86_64.rpm | 91 kB 00:00:00
(4/5): mailcap-2.1.41-2.el7.noarch.rpm | 31 kB 00:00:00
(5/5): apr-1.4.8-5.el7.x86_64.rpm | 103 kB 00:00:02
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 1.3 MB/s | 3.0 MB 00:00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : apr-1.4.8-5.el7.x86_64 1/5
Installing : apr-util-1.5.2-6.el7.x86_64 2/5
Installing : httpd-tools-2.4.6-90.el7.centos.x86_64 3/5
Installing : mailcap-2.1.41-2.el7.noarch 4/5
Installing : httpd-2.4.6-90.el7.centos.x86_64 5/5
Verifying : apr-1.4.8-5.el7.x86_64 1/5
Verifying : mailcap-2.1.41-2.el7.noarch 2/5
Verifying : httpd-tools-2.4.6-90.el7.centos.x86_64 3/5
Verifying : apr-util-1.5.2-6.el7.x86_64 4/5
Verifying : httpd-2.4.6-90.el7.centos.x86_64 5/5
Installed:
httpd.x86_64 0:2.4.6-90.el7.centos
Dependency Installed:
apr.x86_64 0:1.4.8-5.el7 apr-util.x86_64 0:1.5.2-6.el7 httpd-tools.x86_64 0:2.4.6-90.el7.centos mailcap.noarch 0:2.1.41-2.el7
Complete!
systemctl start httpd.service
systemctl enable httpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
yum install -y php70w php70w-mysql php70w-mcrypt php70w-dom php70w-mbstring
Loaded plugins: fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* webtatic: uk.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package php70w.x86_64 0:7.0.33-1.w7 will be installed
--> Processing Dependency: php70w-common(x86-64) = 7.0.33-1.w7 for package: php70w-7.0.33-1.w7.x86_64
--> Processing Dependency: php70w-cli(x86-64) = 7.0.33-1.w7 for package: php70w-7.0.33-1.w7.x86_64
--> Processing Dependency: php70w-cli = 7.0.33-1.w7 for package: php70w-7.0.33-1.w7.x86_64
---> Package php70w-mbstring.x86_64 0:7.0.33-1.w7 will be installed
---> Package php70w-mcrypt.x86_64 0:7.0.33-1.w7 will be installed
--> Processing Dependency: libmcrypt.so.4()(64bit) for package: php70w-mcrypt-7.0.33-1.w7.x86_64
--> Processing Dependency: libltdl.so.7()(64bit) for package: php70w-mcrypt-7.0.33-1.w7.x86_64
---> Package php70w-mysql.x86_64 0:7.0.33-1.w7 will be installed
--> Processing Dependency: php70w-pdo(x86-64) for package: php70w-mysql-7.0.33-1.w7.x86_64
---> Package php70w-xml.x86_64 0:7.0.33-1.w7 will be installed
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.24)(64bit) for package: php70w-xml-7.0.33-1.w7.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.22)(64bit) for package: php70w-xml-7.0.33-1.w7.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.18)(64bit) for package: php70w-xml-7.0.33-1.w7.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.13)(64bit) for package: php70w-xml-7.0.33-1.w7.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.11)(64bit) for package: php70w-xml-7.0.33-1.w7.x86_64
--> Processing Dependency: libxslt.so.1()(64bit) for package: php70w-xml-7.0.33-1.w7.x86_64
--> Processing Dependency: libexslt.so.0()(64bit) for package: php70w-xml-7.0.33-1.w7.x86_64
--> Running transaction check
---> Package libmcrypt.x86_64 0:2.5.8-13.el7 will be installed
---> Package libtool-ltdl.x86_64 0:2.4.2-22.el7_3 will be installed
---> Package libxslt.x86_64 0:1.1.28-5.el7 will be installed
---> Package php70w-cli.x86_64 0:7.0.33-1.w7 will be installed
---> Package php70w-common.x86_64 0:7.0.33-1.w7 will be installed
---> Package php70w-pdo.x86_64 0:7.0.33-1.w7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================================================================================
Installing:
php70w x86_64 7.0.33-1.w7 webtatic 2.8 M
php70w-mbstring x86_64 7.0.33-1.w7 webtatic 544 k
php70w-mcrypt x86_64 7.0.33-1.w7 webtatic 28 k
php70w-mysql x86_64 7.0.33-1.w7 webtatic 84 k
php70w-xml x86_64 7.0.33-1.w7 webtatic 131 k
Installing for dependencies:
libmcrypt x86_64 2.5.8-13.el7 epel 99 k
libtool-ltdl x86_64 2.4.2-22.el7_3 os 49 k
libxslt x86_64 1.1.28-5.el7 os 242 k
php70w-cli x86_64 7.0.33-1.w7 webtatic 2.9 M
php70w-common x86_64 7.0.33-1.w7 webtatic 1.2 M
php70w-pdo x86_64 7.0.33-1.w7 webtatic 93 k
Transaction Summary
=================================================================================================================================================================================================================
Install 5 Packages (+6 Dependent packages)
Total download size: 8.1 M
Installed size: 31 M
Downloading packages:
(1/11): libtool-ltdl-2.4.2-22.el7_3.x86_64.rpm | 49 kB 00:00:00
(2/11): libmcrypt-2.5.8-13.el7.x86_64.rpm | 99 kB 00:00:00
(3/11): libxslt-1.1.28-5.el7.x86_64.rpm | 242 kB 00:00:00
warning: /var/cache/yum/x86_64/7/webtatic/packages/php70w-common-7.0.33-1.w7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 62e74ca5: NOKEY ] 353 kB/s | 2.6 MB 00:00:15 ETA
Public key for php70w-common-7.0.33-1.w7.x86_64.rpm is not installed
(4/11): php70w-common-7.0.33-1.w7.x86_64.rpm | 1.2 MB 00:00:04
(5/11): php70w-mcrypt-7.0.33-1.w7.x86_64.rpm | 28 kB 00:00:00
(6/11): php70w-mbstring-7.0.33-1.w7.x86_64.rpm | 544 kB 00:00:15
(7/11): php70w-7.0.33-1.w7.x86_64.rpm | 2.8 MB 00:00:19
(8/11): php70w-mysql-7.0.33-1.w7.x86_64.rpm | 84 kB 00:00:03
(9/11): php70w-xml-7.0.33-1.w7.x86_64.rpm | 131 kB 00:00:02
(10/11): php70w-pdo-7.0.33-1.w7.x86_64.rpm | 93 kB 00:00:03
(11/11): php70w-cli-7.0.33-1.w7.x86_64.rpm | 2.9 MB 00:01:47
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 77 kB/s | 8.1 MB 00:01:47
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-el7
Importing GPG key 0x62E74CA5:
Userid : "Webtatic EL7 <rpms@webtatic.com>"
Fingerprint: 830d b159 6d9b 9b01 99dc 24a3 e87f d236 62e7 4ca5
Package : webtatic-release-7-3.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-el7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : php70w-common-7.0.33-1.w7.x86_64 1/11
Installing : php70w-cli-7.0.33-1.w7.x86_64 2/11
Installing : php70w-pdo-7.0.33-1.w7.x86_64 3/11
Installing : libmcrypt-2.5.8-13.el7.x86_64 4/11
Installing : libtool-ltdl-2.4.2-22.el7_3.x86_64 5/11
Installing : libxslt-1.1.28-5.el7.x86_64 6/11
Installing : php70w-xml-7.0.33-1.w7.x86_64 7/11
Installing : php70w-mcrypt-7.0.33-1.w7.x86_64 8/11
Installing : php70w-mysql-7.0.33-1.w7.x86_64 9/11
Installing : php70w-7.0.33-1.w7.x86_64 10/11
Installing : php70w-mbstring-7.0.33-1.w7.x86_64 11/11
Verifying : php70w-xml-7.0.33-1.w7.x86_64 1/11
Verifying : php70w-cli-7.0.33-1.w7.x86_64 2/11
Verifying : libxslt-1.1.28-5.el7.x86_64 3/11
Verifying : php70w-mcrypt-7.0.33-1.w7.x86_64 4/11
Verifying : php70w-mysql-7.0.33-1.w7.x86_64 5/11
Verifying : php70w-mbstring-7.0.33-1.w7.x86_64 6/11
Verifying : libtool-ltdl-2.4.2-22.el7_3.x86_64 7/11
Verifying : php70w-common-7.0.33-1.w7.x86_64 8/11
Verifying : php70w-7.0.33-1.w7.x86_64 9/11
Verifying : libmcrypt-2.5.8-13.el7.x86_64 10/11
Verifying : php70w-pdo-7.0.33-1.w7.x86_64 11/11
Installed:
php70w.x86_64 0:7.0.33-1.w7 php70w-mbstring.x86_64 0:7.0.33-1.w7 php70w-mcrypt.x86_64 0:7.0.33-1.w7 php70w-mysql.x86_64 0:7.0.33-1.w7 php70w-xml.x86_64 0:7.0.33-1.w7
Dependency Installed:
libmcrypt.x86_64 0:2.5.8-13.el7 libtool-ltdl.x86_64 0:2.4.2-22.el7_3 libxslt.x86_64 0:1.1.28-5.el7 php70w-cli.x86_64 0:7.0.33-1.w7 php70w-common.x86_64 0:7.0.33-1.w7 php70w-pdo.x86_64 0:7.0.33-1.w7
Complete!
安装 Composer ,用于后续的 php 依赖库的管理
curl -sS https://getcomposer.org/installer | php
All settings correct for using Composer
Downloading...
Composer (version 1.9.3) successfully installed to: /root/composer.phar
Use it: php composer.phar
mv composer.phar /usr/bin/composer
chmod +x /usr/bin/composer
为 Composer 配置国内镜像源
composer config -g repo.packagist composer https://packagist.phpcomposer.com
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
composer config -g repos.packagist composer https://mirrors.cloud.tencent.com/composer/
第一个默认的-我用了不怎么样
第二个阿里-我用
第三个腾讯的
cd /var/www
composer create-project laravel/laravel cloud
Installing laravel/laravel (v5.5.28)
- Installing laravel/laravel (v5.5.28): Downloading (100%)
Created project in cloud
> @php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 77 installs, 0 updates, 0 removals
- Installing kylekatarnls/update-helper (1.2.0): Downloading (100%)
- Installing symfony/thanks (v1.2.5): Downloading (100%)
- Installing symfony/polyfill-ctype (v1.13.1): Downloading (100%)
- Installing vlucas/phpdotenv (v2.6.1): Downloading (100%)
- Installing symfony/css-selector (v3.4.37): Downloading (100%)
- Installing tijsverkoyen/css-to-inline-styles (2.2.2): Downloading (100%)
- Installing symfony/polyfill-mbstring (v1.13.1): Downloading (100%)
- Installing symfony/var-dumper (v3.4.37): Downloading (100%)
- Installing symfony/routing (v3.4.37): Downloading (100%)
- Installing symfony/process (v3.4.37): Downloading (100%)
- Installing symfony/polyfill-php72 (v1.13.1): Downloading (100%)
- Installing symfony/polyfill-intl-idn (v1.13.1): Downloading (100%)
- Installing paragonie/random_compat (v9.99.99): Downloading (100%)
- Installing symfony/polyfill-php70 (v1.13.1): Downloading (100%)
- Installing symfony/http-foundation (v3.4.37): Downloading (100%)
- Installing psr/container (1.0.0): Downloading (100%)
- Installing symfony/event-dispatcher (v3.4.37): Downloading (100%)
- Installing psr/log (1.1.2): Downloading (100%)
- Installing symfony/debug (v3.4.37): Downloading (100%)
- Installing symfony/polyfill-util (v1.13.1): Downloading (100%)
- Installing symfony/polyfill-php56 (v1.13.1): Downloading (100%)
- Installing symfony/http-kernel (v3.4.37): Downloading (100%)
- Installing symfony/finder (v3.4.37): Downloading (100%)
- Installing symfony/console (v3.4.37): Downloading (100%)
- Installing symfony/polyfill-iconv (v1.13.1): Downloading (100%)
- Installing doctrine/lexer (1.0.2): Downloading (100%)
- Installing egulias/email-validator (2.1.15): Downloading (100%)
- Installing swiftmailer/swiftmailer (v6.2.3): Downloading (100%)
- Installing ramsey/uuid (3.9.2): Downloading (100%)
- Installing psr/simple-cache (1.0.1): Downloading (100%)
- Installing symfony/translation (v3.4.37): Downloading (100%)
- Installing nesbot/carbon (1.39.1): Downloading (100%)
- Installing mtdowling/cron-expression (v1.2.3): Downloading (100%)
- Installing monolog/monolog (1.25.3): Downloading (100%)
- Installing league/flysystem (1.0.64): Downloading (100%)
- Installing erusev/parsedown (1.7.4): Downloading (100%)
- Installing doctrine/inflector (v1.2.0): Downloading (100%)
- Installing laravel/framework (v5.5.48): Downloading (100%)
- Installing fideloper/proxy (3.3.4): Downloading (100%)
- Installing jakub-onderka/php-console-color (v0.2): Downloading (100%)
- Installing jakub-onderka/php-console-highlighter (v0.4): Downloading (100%)
- Installing nikic/php-parser (v4.3.0): Downloading (100%)
- Installing dnoegel/php-xdg-base-dir (v0.1.1): Downloading (100%)
- Installing psy/psysh (v0.9.12): Downloading (100%)
- Installing laravel/tinker (v1.0.10): Downloading (100%)
- Installing filp/whoops (2.7.1): Downloading (100%)
- Installing fzaninotto/faker (v1.9.1): Downloading (100%)
- Installing hamcrest/hamcrest-php (v2.0.0): Downloading (100%)
- Installing mockery/mockery (1.3.1): Downloading (100%)
- Installing sebastian/version (2.0.1): Downloading (100%)
- Installing sebastian/resource-operations (1.0.0): Downloading (100%)
- Installing sebastian/recursion-context (3.0.0): Downloading (100%)
- Installing sebastian/object-reflector (1.1.1): Downloading (100%)
- Installing sebastian/object-enumerator (3.0.3): Downloading (100%)
- Installing sebastian/global-state (2.0.0): Downloading (100%)
- Installing sebastian/exporter (3.1.2): Downloading (100%)
- Installing sebastian/environment (3.1.0): Downloading (100%)
- Installing sebastian/diff (2.0.1): Downloading (100%)
- Installing sebastian/comparator (2.1.3): Downloading (100%)
- Installing doctrine/instantiator (1.0.5): Downloading (100%)
- Installing phpunit/php-text-template (1.2.1): Downloading (100%)
- Installing phpunit/phpunit-mock-objects (5.0.10): Downloading (100%)
- Installing phpunit/php-timer (1.0.9): Downloading (100%)
- Installing phpunit/php-file-iterator (1.4.5): Downloading (100%)
- Installing theseer/tokenizer (1.1.3): Downloading (100%)
- Installing sebastian/code-unit-reverse-lookup (1.0.1): Downloading (100%)
- Installing phpunit/php-token-stream (2.0.2): Downloading (100%)
- Installing phpunit/php-code-coverage (5.3.2): Downloading (100%)
- Installing webmozart/assert (1.6.0): Downloading (100%)
- Installing phpdocumentor/reflection-common (1.0.1): Downloading (100%)
- Installing phpdocumentor/type-resolver (0.5.1): Downloading (100%)
- Installing phpdocumentor/reflection-docblock (4.3.4): Downloading (100%)
- Installing phpspec/prophecy (v1.10.2): Downloading (100%)
- Installing phar-io/version (1.0.1): Downloading (100%)
- Installing phar-io/manifest (1.0.1): Downloading (100%)
- Installing myclabs/deep-copy (1.7.0): Downloading (100%)
- Installing phpunit/phpunit (6.5.14): Downloading (100%)
symfony/var-dumper suggests installing ext-intl (To show region name in time zone dump)
symfony/var-dumper suggests installing ext-symfony_debug
symfony/routing suggests installing symfony/config (For using the all-in-one router or any loader)
symfony/routing suggests installing symfony/yaml (For using the YAML loader)
symfony/routing suggests installing symfony/expression-language (For using expression matching)
symfony/routing suggests installing doctrine/annotations (For using the annotation loader)
symfony/polyfill-intl-idn suggests installing ext-intl (For best performance)
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
symfony/event-dispatcher suggests installing symfony/dependency-injection
symfony/http-kernel suggests installing symfony/browser-kit
symfony/http-kernel suggests installing symfony/config
symfony/http-kernel suggests installing symfony/dependency-injection
symfony/console suggests installing symfony/lock
egulias/email-validator suggests installing ext-intl (PHP Internationalization Libraries are required to use the SpoofChecking validation)
swiftmailer/swiftmailer suggests installing ext-intl (Needed to support internationalized email addresses)
swiftmailer/swiftmailer suggests installing true/punycode (Needed to support internationalized email addresses, if ext-intl is not installed)
ramsey/uuid suggests installing ext-libsodium (Provides the PECL libsodium extension for use with the SodiumRandomGenerator)
ramsey/uuid suggests installing ext-uuid (Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator)
ramsey/uuid suggests installing moontoast/math (Provides support for converting UUID to 128-bit integer (in string form).)
ramsey/uuid suggests installing ramsey/uuid-console (A console application for generating UUIDs with ramsey/uuid)
ramsey/uuid suggests installing ramsey/uuid-doctrine (Allows the use of Ramsey\Uuid\Uuid as Doctrine field type.)
ramsey/uuid suggests installing paragonie/random-lib (Provides RandomLib for use with the RandomLibAdapter)
symfony/translation suggests installing symfony/config
symfony/translation suggests installing symfony/yaml
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing sentry/sentry (Allow sending log messages to a Sentry server)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing php-amqplib/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages to a MongoDB server via PHP Driver)
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)
league/flysystem suggests installing league/flysystem-eventable-filesystem (Allows you to use EventableFilesystem)
league/flysystem suggests installing league/flysystem-rackspace (Allows you to use Rackspace Cloud Files)
league/flysystem suggests installing league/flysystem-azure (Allows you to use Windows Azure Blob storage)
league/flysystem suggests installing league/flysystem-webdav (Allows you to use WebDAV storage)
league/flysystem suggests installing league/flysystem-aws-s3-v2 (Allows you to use S3 storage with AWS SDK v2)
league/flysystem suggests installing league/flysystem-aws-s3-v3 (Allows you to use S3 storage with AWS SDK v3)
league/flysystem suggests installing spatie/flysystem-dropbox (Allows you to use Dropbox storage)
league/flysystem suggests installing srmklive/flysystem-dropbox-v2 (Allows you to use Dropbox storage for PHP 5 applications)
league/flysystem suggests installing league/flysystem-cached-adapter (Flysystem adapter decorator for metadata caching)
league/flysystem suggests installing league/flysystem-sftp (Allows you to use SFTP server storage via phpseclib)
league/flysystem suggests installing league/flysystem-ziparchive (Allows you to use ZipArchive adapter)
laravel/framework suggests installing ext-posix (Required to use all features of the queue worker.)
laravel/framework suggests installing aws/aws-sdk-php (Required to use the SQS queue driver and SES mail driver (~3.0).)
laravel/framework suggests installing doctrine/dbal (Required to rename columns and drop SQLite columns (~2.5).)
laravel/framework suggests installing guzzlehttp/guzzle (Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (~6.0).)
laravel/framework suggests installing league/flysystem-aws-s3-v3 (Required to use the Flysystem S3 driver (~1.0).)
laravel/framework suggests installing league/flysystem-rackspace (Required to use the Flysystem Rackspace driver (~1.0).)
laravel/framework suggests installing league/flysystem-cached-adapter (Required to use Flysystem caching (~1.0).)
laravel/framework suggests installing nexmo/client (Required to use the Nexmo transport (~1.0).)
laravel/framework suggests installing pda/pheanstalk (Required to use the beanstalk queue driver (~3.0).)
laravel/framework suggests installing predis/predis (Required to use the redis cache and queue drivers (~1.0).)
laravel/framework suggests installing pusher/pusher-php-server (Required to use the Pusher broadcast driver (~3.0).)
laravel/framework suggests installing symfony/dom-crawler (Required to use most of the crawler integration testing tools (~3.3).)
laravel/framework suggests installing symfony/psr-http-message-bridge (Required to psr7 bridging features (~1.0).)
psy/psysh suggests installing ext-posix (If you have PCNTL, you'll want the POSIX extension as well.)
psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)
psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.)
filp/whoops suggests installing whoops/soap (Formats errors as SOAP responses)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit-mock-objects suggests installing ext-soap (*)
phpunit/php-code-coverage suggests installing ext-xdebug (^2.5.5)
phpunit/phpunit suggests installing phpunit/php-invoker (^1.1)
phpunit/phpunit suggests installing ext-xdebug (*)
Package mtdowling/cron-expression is abandoned, you should avoid using it. Use dragonmantank/cron-expression instead.
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating optimized autoload files
Carbon 1 is deprecated, see how to migrate to Carbon 2.
https://carbon.nesbot.com/docs/#api-carbon-2
You can run './vendor/bin/upgrade-carbon' to get help in updating carbon and other frameworks and libraries that depend on it.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Package manifest generated successfully.
> @php artisan key:generate
Application key [base64:PSENNZYgYI6cc7G85NokKGTRtXdT5Va2uwIG0oQ45Pc=] set successfully.
cd cloud
chown apache:apache -R *
我们就完成了一个 Laravel 项目(cloud)的创建。
推荐用WinSCP
修改 /var/www/cloud/app/Providers/AppServiceProvider.php 文件
改成:
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
class AppServiceProvider extends ServiceProvider
{
public function boot()
{
Schema::defaultStringLength(191);
}
public function register()
{
}
}
修改 Laravel 配置文件,添加数据库(laravel)信息
mysql -uroot -p -e “create database laravel;”
Enter password: //输Mysql密码
修改 /var/www/cloud/.env
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:Wi0qQG1pXdGp5U7uM4Q2eAA2zdxTg8yM4wyo61HvL6g=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel(数据库名字)
DB_USERNAME=root
DB_PASSWORD=你设置的root密码
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
设置完成后,执行如下命令来生成数据库。
php /var/www/cloud/artisan migrate
Migration table created successfully.
Migrating: 2014_10_12_000000_create_users_table
Migrated: 2014_10_12_000000_create_users_table
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated: 2014_10_12_100000_create_password_resets_table
创建/etc/httpd/conf.d/laravel.conf
<VirtualHost *:80>
DocumentRoot "/var/www/cloud/public"
ServerName <您的 CVM IP 地址>
</VirtualHost>
重启apche
systemctl restart httpd.service
完成
登上你的域名可见laravel
另个版本教程
视频教程:https://ke.qq.com/course/339078?taid=2514497193716870