本文最后更新于 2024-12-21,文章内容可能已经过时,请注意发布时间。

前置

需要Swwoole

安装

安装Laravels

composer require hhxsv5/laravel-s
php artisan laravels publish

.env配置


# Laravel S 配置
LARAVELS_LISTEN_IP=0.0.0.0
LARAVELS_LISTEN_PORT=8899
LARAVELS_WORKER_NUM=4

启动

然后就可以进入你的项目根目录执行

php bin/laravels start

生产环境建议使用进程守护

[program:laravel-s-test]
command=php /www/wwwroot/lms/blog/bin/laravels start -i
numprocs=1
autostart=true
autorestart=true
startretries=3
user=root
redirect_stderr=true
stdout_logfile=/www/wwwroot/lms/blog/storage/logs/supervisord-stdout.log

当前我使用的PHP扩展

[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gettext
hash
iconv
igbinary
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
random
readline
redis
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
swoole
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zlib

[Zend Modules]
Zend OPcache