欢迎光临
我们一直在努力

Turso libSQL 安装程序

你好朋克!是的,我是,在这篇日志中我想与您分享如何在您的 php 环境中安装 libsql,而不必担心在您当前的 php 版本中配置 php.ini 文件。

安装 php 的 libsql 扩展,就像安装 composer 包一样:

composer require vendor/package

安装 php 的 libsql 扩展

turso-php-installer install

turso php installer

无论如何…我想让你知道 punk’in 单文件安装程序脚本如何工作并为你设置它。

帮助命令

您已经在上图中看到了。这就是帮助命令的作用。

安装命令

安装命令在安装 php 的 libsql 扩展之前会做一些必要的检查,会问什么问题? (后台查看)

您使用的是 windows 吗?

尽管 turso client php 具有针对 windows msvc 2022 构建的扩展。但是,使用此安装程序脚本的安装过程不适用于 windows。 wsl 可以工作,或者您可以使用 turso docker php!

如果您使用的是 windows,那么您将收到此消息:

> turso-php-installer install # in windows
sorry, turso php installer is only support for <a style="color:#f60; text-decoration:underline;" href="https://www.codesou.cn/" target="_blank">linux</a> and <a style="color:#f60; text-decoration:underline;" href="https://www.codesou.cn/" target="_blank">macos</a>.

you are using windows, you can try our alternative using dev containers
visit: https://<a style="color:#f60; text-decoration:underline;" href="https://www.codesou.cn/" target="_blank">git</a>hub.com/darkterminal/turso-docker-php

thank you!

你在使用 laravel herd 吗?

天哪…安装程序还不支持 laravel herd。但我很快就会支持,你可以在 herd 社区 github discussion 上关注这个讨论。

$ turso-php-installer install
you are using laravel herd
sorry, laravel herd is not supported yet.
you can try our alternative using dev containers
visit: https://github.com/darkterminal/turso-docker-php

thank you!

已经安装

有时我忘记什么时候已经安装了。

$ turso-php-installer install
turso client php is already installed and configured!

哪个 php 版本?

适用于 php 的 turso 客户端 php / libsql 扩展至少需要 php 8.0 及更高版本。您可以在 turso client php – release 页面看到它

如果你的 php 低于最低要求,那么就会失败

$ turso-php-installer install
oops! your php version environment does not meet the requirements.
need a minimal php 8.0 installed on your environment.

检查php.ini

需要查找安装程序脚本

$ turso-php-installer install
you don't have php install globaly in your environment
turso client php lookup php.ini file and it's not found

检查所需功能

安装脚本还需要shell_exec和curl函数

$ turso-php-installer install
it looks like the 'shell_exec' and 'curl_version' functions are disabled in your php environment. these functions are essential for this script to work properly.
to enable them, follow these steps:
1. open your 'php.ini' file. you can find the location of your 'php.ini' file by running the command 'php --ini' in your terminal or command prompt.
2. search for 'disable_functions' directive. it might look something like this:
disable_functions = shell_exec, curl_version
3. remove 'shell_exec' and 'curl_version' from this list. it should look like:
disable_functions =
4. save the 'php.ini' file.
5. restart your web server for the changes to take effect. if you are using <a style="color:#f60; text-decoration:underline;" href="https://www.codesou.cn/" target="_blank">apache</a>, you can restart it with:
sudo service apache2 restart
or for <a style="color:#f60; text-decoration:underline;" href="https://www.codesou.cn/" target="_blank">nginx</a>:
sudo service nginx restart
if you are using a web hosting service, you might need to contact your hosting provider to enable these functions for you.
for more information on 'shell_exec', visit: https://www.php.net/manual/en/function.shell-exec.php
for more information on 'curl_version', visit: https://www.php.net/manual/en/function.curl-version.php
thank you!

请求许可

安装程序需要以sudo角色运行,因为安装程序需要在您的环境中编写php.ini文件。

$ turso-php-installer install
Turso need to install the client extension in your PHP environment.
This script will ask your sudo password to modify your php.ini file:
Are you ok? [y/N]: 

下载并解压

满足所有要求后,安装程序将根据您环境中使用的当前 php 版本下载并提取 php 的 libsql 扩展,并将其存储在 $home/.turso-client-php


使用 turso driver laravel 和 turso doctrine dbal 之前需要扩展

赞(0) 打赏
未经允许不得转载:码农资源网 » Turso libSQL 安装程序
分享到

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫打赏

微信扫一扫打赏

登录

找回密码

注册