Code Monkey home page Code Monkey logo

Comments (13)

Lete114 avatar Lete114 commented on August 26, 2024

请自行查看typecho要求的对应php版本,修改vercel.json中的"runtime": "[email protected]"字段
image

from vercel-typecho.

a52948 avatar a52948 commented on August 26, 2024

设的是[email protected]

from vercel-typecho.

36304099 avatar 36304099 commented on August 26, 2024

同样的问题,运行install.php页面报错:
`
Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /var/task/user/var/Typecho/Db/Adapter/Pdo/Mysql.php on line 97

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /var/task/user/var/Typecho/Db/Adapter/Pdo/Mysql.php on line 98

Warning: Cannot modify header information - headers already sent by (output started at /var/task/user/var/Typecho/Db/Adapter/Pdo/Mysql.php:97) in /var/task/user/var/Typecho/Response.php on line 225`

fork的代码里 vercel.json-> "runtime": "[email protected]"

不知道php版本怎么看

from vercel-typecho.

36304099 avatar 36304099 commented on August 26, 2024

image
放了个php探针,检测不到php版本信息

from vercel-typecho.

JIeJaitt avatar JIeJaitt commented on August 26, 2024

同样的问题,运行install.php页面报错: ` Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /var/task/user/var/Typecho/Db/Adapter/Pdo/Mysql.php on line 97

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /var/task/user/var/Typecho/Db/Adapter/Pdo/Mysql.php on line 98

Warning: Cannot modify header information - headers already sent by (output started at /var/task/user/var/Typecho/Db/Adapter/Pdo/Mysql.php:97) in /var/task/user/var/Typecho/Response.php on line 225`

fork的代码里 vercel.json-> "runtime": "[email protected]"

不知道php版本怎么看

同样的问题,请问您解决了吗?

from vercel-typecho.

hao888777 avatar hao888777 commented on August 26, 2024

直接fork这个项目修改并部署好像就会有这个问题,后来我仔细跟着作者博客的教程新建文件然后从官网下最新版typecho复制下就没问题了。
另外首次安装时可能会遇到”上传目录无法写入, 请手动将安装目录下的 /usr/uploads 目录的权限设置为可写然后继续升级“,我的解决办法是先在本地部署初始化数据库,然后把初始化后的数据再写到config.inc.php配置的数据库里,直接跳过安装步骤。

from vercel-typecho.

JIeJaitt avatar JIeJaitt commented on August 26, 2024

@hao888777 问下大佬数据库你用的哪家的,部署后访问加载速度如何?

from vercel-typecho.

hao888777 avatar hao888777 commented on August 26, 2024

@hao888777 问下大佬数据库你用的哪家的,部署后访问加载速度如何?

我现在用的数据库是自己服务器上搭的,之前用过freedb.tech但是效果不好,查询频率限制很多。(不过用了我自己的访问速度其实也挺一般的。

from vercel-typecho.

JIeJaitt avatar JIeJaitt commented on August 26, 2024

from vercel-typecho.

JIeJaitt avatar JIeJaitt commented on August 26, 2024

@hao888777 请问大佬你填的是[email protected]吗?我部署后可以访问后台,但是访问前台就会出现This Serverless Function has timed out.

from vercel-typecho.

hao888777 avatar hao888777 commented on August 26, 2024

@hao888777 请问大佬你填的是[email protected]吗?我部署后可以访问后台,但是访问前台就会出现This Serverless Function has timed out.

是的,我填的也是"runtime": "[email protected]",Typecho的版本是1.2.1。另外”This Serverless Function has timed out.“这个问题你可以参考下这个issue,也许是你的数据库的链接有问题?

from vercel-typecho.

JIeJaitt avatar JIeJaitt commented on August 26, 2024

@hao888777 由于我对php不是太熟悉,所以我启动在本地的时候是localhost8000端口,部署到vercel之后启用了域名,可能数据库里面和网站的一些东西对不上所以导致的,其实应该在本地启动的时候就映射8000到域名来在本地部署应该可以解决这个问题(我也不确定,没试过)。

后面我还是通过注释代码取消安装时检测上传限制的方法成功部署在了vercel,并且我使用的是vercel自带的pgsql数据库,vercel的数据库是在美东1区,pgsql也是美东一区,配上个vercel的cname-china dns速度我觉得挺快的,大佬你可以访问下我的测试站看看vercel-typecho-test,服务器可能是跟vercel服务器的站点相差过远才可能导致的延迟过高。后续再考虑加上cdn,gzip压缩之类的。

另外一个问题就是vercel的免费版pgsql有点抠门,每月只有60hrs/0.25cpu=240h的使用时间,我感觉有点不够用,于是我正打算通过给typecho添加redis缓存来解决这个问题,防止频道的读写vercel的pgsql数据库,这样免费版的资源应该才是够用的,但是目前我还没有成功的给typecho填加上缓存,遇到了各种各样的问题。

from vercel-typecho.

hao888777 avatar hao888777 commented on August 26, 2024

@hao888777 由于我对php不是太熟悉,所以我启动在本地的时候是localhost8000端口,部署到vercel之后启用了域名,可能数据库里面和网站的一些东西对不上所以导致的,其实应该在本地启动的时候就映射8000到域名来在本地部署应该可以解决这个问题(我也不确定,没试过)。

后面我还是通过注释代码取消安装时检测上传限制的方法成功部署在了vercel,并且我使用的是vercel自带的pgsql数据库,vercel的数据库是在美东1区,pgsql也是美东一区,配上个vercel的cname-china dns速度我觉得挺快的,大佬你可以访问下我的测试站看看vercel-typecho-test,服务器可能是跟vercel服务器的站点相差过远才可能导致的延迟过高。后续再考虑加上cdn,gzip压缩之类的。

另外一个问题就是vercel的免费版pgsql有点抠门,每月只有60hrs/0.25cpu=240h的使用时间,我感觉有点不够用,于是我正打算通过给typecho添加redis缓存来解决这个问题,防止频道的读写vercel的pgsql数据库,这样免费版的资源应该才是够用的,但是目前我还没有成功的给typecho填加上缓存,遇到了各种各样的问题。

😂我其实也不太熟悉php;你的测试站访问速度确实挺快的,后来我又研究了一下,原来是Cloudflare的cdn的问题,我的域名在CF上总是习惯开cdn,没想到这次成减速器了。然后我取消了cdn直接解析vercel的ip后响应速度快了不少,我这边网络ping下CF的ip在300ms延时左右,vercel差不多100ms,看来vercel虽然域名被ban了,但是这个ip质量很高啊。这个数据库限制使用时间的吗,那确实挺难受的,我之前也想搞redis插件,后来嫌麻烦就没弄,而且好像有一些bug,不少插件还停更了。

from vercel-typecho.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.