Workerman[start.php] start in DEBUG 调试模式 远程会话关闭则关闭

看了下thinkphp6 里面的完全手册 命令

think worker start -d (其实这里是错误的) 我一直进入都是Debug模式

正确的命令应该是: 开启 不需要再添加start

think worker -d (进入守护进程模式) 远程会话关闭继续可以链接

操作系统 centos 7.6
Tags:linux php加入系统变量 永久

1.打开文件
vi /etc/profile
2.在文件尾部添加以下代码
[i]
export PATH=/www/server/php/72/bin:$PATH
[esc]
[:wq]
3.生效配置
source /etc/profile
4.查看更改后的变量值
echo $PATH

【7.2.18】
说明:此实例是在宝塔面板基础上进行安装扩展(原先我使用了apache2.8+php7.2.18+mysql5.6.27)

1.下载扩展

wget https://www.php.net/distributions/php-7.2.18.tar.gz

2.解压文件

tar -xvf php-7.2.18.tar.gz
3.打开目录

cd php-7.2.18/ext/fileinfo

4.直接执行以下命令 找不到 whice phpnize
/www/server/php/72/bin/phpize
返回:
Configuring for:
PHP Api Version: 20170718
Zend Module Api No: 20170718
Zend Extension Api No: 320170718
5.初始化配置
./configure --with-php-config=/www/server/php/72/bin/php-config
6.出现报错
make: * No targets specified and no makefile found. Stop.
virtual memory exhausted: Cannot allocate memory
显示内存不足 对于我的1GB小主机 使用不了 这时候需要创临时空间
解决办法:内存不足, 在linux下增加临时swap空间

参考《在linux下增加临时swap空间》
https://blog.csdn.net/qq_32642039/article/details/78070813?locationNum=7&fps=1

step 1:
  #sudo dd if=/dev/zero of=/home/swap bs=64M count=16
  注释:of=/home/swap,放置swap的空间; count的大小就是增加的swap空间的大小,64M就是块大小,这里是64MB,所以总共空间就是bs*count=1024MB.这里分配空间的时候需要一点时间,等待执行完毕。
  
step 2:
  # sudo mkswap /home/swap (可能会提示warning: don’t erase bootbits sectorson whole disk. Use -f to force,不用理会)
  注释:把刚才空间格式化成swap各式
step 3:
  #sudo swapon /home/swap
  注释:使刚才创建的swap空间

7.直接安装
make && make install

显示:

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:

  • add LIBDIR to the `LD_LIBRARY_PATH' environment variable
    during execution
  • add LIBDIR to the `LD_RUN_PATH' environment variable
    during linking
  • use the `-Wl,--rpath -Wl,LIBDIR' linker flag
  • have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for

more information, such as the ld(1) and ld.so(8) manual pages.

8.配置扩展

vi /www/server/php/72/etc/php.ini
添加以下:
extension = /www/server/php/72/lib/php/extensions/no-debug-non-zts-20170718/fileinfo.so

为避免走弯路,本教程思路分为以下3个步骤。
这里只实现到安装tp6.0 后续tp6.0开发教程另外记录。

1.安装composer 并设置系统变量

composer.exe可以到官网下载https://getcomposer.org/download/

安装过程中选择php版本,下一步即可
D:phpStudyphp70n (phpstudy)

我这里选择的

可以在这点击下载,以后使用

composer update

更新 composer 版本

composer selfupdate

Composer-Setup.rar

2.将composer镜像换成国内的,方便下载

composer config -g repo.packagist composer https://mirrors.aliyun.com/com
poser/

3.打开项目路径,下载tp框架并更改项目名称

打开cmd命令窗口,输入cd D:/www  这里是我的项目路径根目录
下载框架并命名为tpdemo

composer create-project topthink/think tpdemo