官方的zmq已多年不维护了,并且在php7.4中报错,所以只能选择第三方的了
wget https://github.com/stijnvdb88/php-zmq/archive/refs/tags/v4.3.4.tar.gz
tar -xvzf php-zmq-4.3.4.tar.gz
mv php-zmq-4.3.4 /usr/src/php/ext/php-zmq
#安装依赖
apt-get install -y libzmq3-dev
#安装扩展
docker-php-ext-install php-zmq
这个也是多年未更新了,据说是作者电脑丢了,代码都在里面😂
现在最新的composer是2.5.5
,直接执行这个包会报如下错误
The package name jupyter-php-instance is invalid, it should be lowercase and have a vendor name, a forward slash, and a package name, matching: [a-z0-9_.-]+/[a-z0-9_.-]+
下面把composer降到1.8.5
root@php-jupyter:~# composer self-update 1.8.5
Upgrading to version 1.8.5 (stable channel).
Use composer self-update --rollback to return to version 2.5.5
接着,下载并安装
curl -sS -o /tmp/jupyter-php-installer.phar https://litipk.github.io/Jupyter-PHP-Installer/dist/jupyter-php-installer.phar
php /tmp/jupyter-php-installer.phar install -v
#查看可用的内核列表
jupyter kernelspec list
#查看服务列表
jupyter server list
至此,PHP内核就安装完成了。