原稿来自无尘
service ssh start
docker 部署 nginx 需要注意:sudo DEBIAN_FRONTEND=noninteractive apt-get -y install [packagename]
如果需要运行级别 : RUNLEVEL=1
docker 安装php 一键指令:
apt update
&& DEBIAN_FRONTEND=noninteractive apt install -y software-properties-common
&& DEBIAN_FRONTEND=noninteractive add-apt-repository -y ppa:ondrej/php
&& apt-get update && DEBIAN_FRONTEND=noninteractive RUNLEVEL=1 apt install -y php8.1 php8.1-cli php8.1-fpm php8.1-mbstring php8.1-xml php8.1-bcmath php8.1-curl php8.1-gd php8.1-mysql php8.1-opcache php8.1-zip php8.1-sqlite3
&& php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
&& php composer-setup.php
&& php -r "unlink('composer-setup.php');"
&& cp composer.phar /usr/bin/composer
&& composer -g config repo.packagist composer https://mirrors.aliyun.com/composer/ && apt update
&& DEBIAN_FRONTEND=noninteractive apt install -y unzip
&& composer global require laravel/installer
docker 安装composer 一键指令
php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
composer -g config repo.packagist composer https://mirrors.aliyun.com/composer/
composer global require laravel/installer
laravel new example-app
cd example-app
php artisan serve --host 0.0.0.0
sudo apt update
sudo apt upgrade
sudo apt install nginx -y
nginx -v
sudo apt install -y software-properties-common
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update
sudo apt install -y php7.4 php7.4-cli php7.4-fpm php7.4-mbstring php7.4-xml php7.4-bcmath php7.4-curl php7.4-gd php7.4-mysql php7.4-opcache php7.4-zip php7.4-sqlite3
php -v
sudo apt-get install mysql-server
apt-get install mysql-client
sudo apt-get install libmysqlclient-dev
sudo mysql -u root -p
(默认回车)
create user 'test'@'localhost' identified by '123456';
(外网访问)
create user 'test'@'%' identified by '123456';
(刷新权限)
flush privileges;
quit;
apt install redis -y
sudo apt install -y git
sudo git --version
sudo apt-get install composer
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
composer global require hirak/prestissimo
sudo systemctl start nginx
systemctl status nginx
sudo apt install unzip -y
composer create-project laravel/laravel docs
- composer global require laravel/installer
- laravel new blog
cd /etc/nginx/sites-available
touch laravel
sudo vim laravel
里面内容:详情见ubuntu部署laravel.txt
sudo vim /etc/nginx/nginx.conf
末尾添加 include /etc/nginx/sites-enabled/*;
systemctl reload nginx
php artisan serve --host=192.168.0.98 --port=8000
- Cannot create cache directory /home/atlas/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
sudo chown -R $USER ~/.composer/
Warning from https://packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/
1. apt-get purge composer
2. php -r "copy('https://getcomposer.org/installer','composer-setup.php');"
3. sudo php composer-setup.php --install-dir=/usr/bin --filename=composer;
4. composer self-update
Failed to decode zlib stream
sudo apt-get install -y zlibc