电脑是 Ubuntu 18.04 LTS
sudo apt-get update
sudo apt-get install curl php7.4-cli -y
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
composer create-project topthink/think tp
然后用浏览器打开 http://localhost/tp/public/index.php 正常.
离线
$
$ sudo composer create-project topthink/think ./
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Installing topthink/think (v6.0.2)
- Installing topthink/think (v6.0.2): Downloading (100%)
Created project in ./
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 14 installs, 0 updates, 0 removals
- Installing psr/container (1.0.0): Downloading (100%)
- Installing topthink/think-helper (v3.1.3): Downloading (100%)
- Installing psr/log (1.1.2): Downloading (100%)
- Installing psr/simple-cache (1.0.1): Downloading (100%)
- Installing topthink/think-orm (v2.0.31): Downloading (100%)
- Installing symfony/polyfill-php72 (v1.13.1): Downloading (100%)
- Installing symfony/polyfill-mbstring (v1.13.1): Downloading (100%)
- Installing symfony/var-dumper (v4.4.3): Downloading (100%)
- Installing opis/closure (3.5.1): Downloading (100%)
- Installing psr/cache (1.0.1): Downloading (100%)
- Installing league/flysystem (1.0.63): Downloading (100%)
- Installing league/flysystem-cached-adapter (1.0.9): Downloading (100%)
- Installing topthink/framework (v6.0.2): Downloading (100%)
- Installing topthink/think-trace (v1.2): Downloading (100%)
symfony/var-dumper suggests installing ext-intl (To show region name in time zone dump)
symfony/var-dumper suggests installing symfony/console (To use the ServerDumpCommand and/or the bin/var-dump-server script)
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-sftp (Allows you to use SFTP server storage via phpseclib)
league/flysystem suggests installing league/flysystem-ziparchive (Allows you to use ZipArchive adapter)
league/flysystem-cached-adapter suggests installing ext-phpredis (Pure C implemented extension for PHP)
Writing lock file
Generating autoload files
> @php think service:discover
Succeed!
> @php think vendor:publish
Succeed!
$
$
安装成功.
离线
#
# composer create-project topthink/think ./
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Installing topthink/think (v5.1.39)
- Installing topthink/think (v5.1.39): Loading from cache
Created project in ./
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
- Installing topthink/think-installer (v2.0.0): Loading from cache
- Installing topthink/framework (v5.1.39): Loading from cache
Writing lock file
Generating autoload files
#
#
另外这台也是 Ubuntu18.04 的, 但是只能装 v5.1.39 版本.
离线
sudo composer create-project topthink/think ./ 6.0.2
sudo composer create-project topthink/think ./ 5.1.39
装上 php7之后, 就可以装 thinkphp6了, 最后一个参数指定版本.
离线
sudo apt-get install php7.4 php7.4-common php7.4-mbstring -y
sudo phpenmod -v 7.4 opcache pdo xml calendar ctype dom exif ffi fileinfo ftp gettext iconv json phar posix readline shmop simplexml sockets sysvmsg sysvsem sysvshm tokenizer xmlreader xmlwriter xsl mbstring
终于安装成功了:
# sudo composer create-project topthink/think ./ 6.0.2
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Installing topthink/think (v6.0.2)
- Installing topthink/think (v6.0.2): Loading from cache
Created project in ./
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 14 installs, 0 updates, 0 removals
- Installing psr/container (1.0.0): Downloading (100%)
- Installing topthink/think-helper (v3.1.3): Downloading (100%)
- Installing psr/log (1.1.2): Downloading (100%)
- Installing psr/simple-cache (1.0.1): Downloading (100%)
- Installing topthink/think-orm (v2.0.31): Downloading (100%)
- Installing symfony/polyfill-php72 (v1.13.1): Downloading (100%)
- Installing symfony/polyfill-mbstring (v1.13.1): Downloading (100%)
- Installing symfony/var-dumper (v4.4.3): Downloading (100%)
- Installing opis/closure (3.5.1): Downloading (100%)
- Installing psr/cache (1.0.1): Downloading (100%)
- Installing league/flysystem (1.0.63): Downloading (100%)
- Installing league/flysystem-cached-adapter (1.0.9): Downloading (100%)
- Installing topthink/framework (v6.0.2): Downloading (100%)
- Installing topthink/think-trace (v1.2): Downloading (100%)
symfony/var-dumper suggests installing ext-intl (To show region name in time zone dump)
symfony/var-dumper suggests installing symfony/console (To use the ServerDumpCommand and/or the bin/var-dump-server script)
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-sftp (Allows you to use SFTP server storage via phpseclib)
league/flysystem suggests installing league/flysystem-ziparchive (Allows you to use ZipArchive adapter)
league/flysystem-cached-adapter suggests installing ext-phpredis (Pure C implemented extension for PHP)
Writing lock file
Generating autoload files
> @php think service:discover
Succeed!
> @php think vendor:publish
Succeed!
#
离线
sudo apt-get remove php5* -y
sudo apt-get install php7.4 php7.4-common php7.4-mbstring -y
a2enmod php7.4
sudo composer create-project topthink/think ./ 6.0.2
这样终于把 thinkphp 6.0.2 在另外一台Ubuntu18.04 跑起来了.
离线
sudo composer create-project topthink/think ./ 6.0.2 sudo composer create-project topthink/think ./ 5.1.39
装上 php7之后, 就可以装 thinkphp6了, 最后一个参数指定版本.
感谢分享, 原来创建项目一定要这个命令哦。
sudo composer create-project topthink/think ./ 6.0.2
然后多应用模式用下面的命令安装:
composer require topthink/think-multi-app
离线
sudo composer create-project topthink/think ./ 6.0.2 sudo composer create-project topthink/think ./ 5.1.39
装上 php7之后, 就可以装 thinkphp6了, 最后一个参数指定版本.
我们的项目甲方指定能用 php5.6, 看来只能装 thinkphp5 了
sudo composer create-project topthink/think ./ 5.1.39
离线