php - 安装 Herd 并返回 Valet 后为 502

标签 php laravel postgresql nginx valet

我很高兴尝试刚刚发布的 Laravel Herd ( https://herd.laravel.com ),所以我没有看到里面没有 pdo_pgsql 扩展(而且我们无法手动添加它)。

所以我启动它,在使用 postgresql 数据库的应用程序上没有任何效果。

我要回去当代客。正确删除 Herd ( https://herd.laravel.com/docs/1/troubleshooting/uninstalling ) 并确保再次运行代客安装。

从那时起,我在每个使用 postgresql 的应用程序上都收到了 502 Bad Gateway。如果我转到 Dbgnin 并关闭数据库,我会收到一个实际的 laravel 错误,指出它无法连接。


代客 nginx 日志:

[error] 11752#0: *91 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: , request: "POST /login HTTP/1.1"

php-fpm 日志:

[21-Jul-2023 08:02:46] WARNING: [pool valet] child 14476 exited on signal 6 (SIGABRT) after 216.252544 seconds from start
[21-Jul-2023 08:02:46] NOTICE: [pool valet] child 14518 started

以我有限的服务器管理知识,我相信 PHP 和 Valet 应该可以正常工作,因为使用 Mysql 或 Sqlite 数据库的所有其他站点(本地)都可以正常运行。我关心的是 Postgresql 和 PHP 扩展。对于这种特定情况,我需要使用 Postgresql 版本 12。但是,当我检查 phpinfo 时,我注意到扩展 pdo_pgsql 和 pgsql 版本为 15.3。是否存在冲突,如果是,我找不到任何方法来降级扩展版本。

到目前为止我尝试过的:

  • 重新安装 php、pdo_pgsql 和 pgsql
  • 单独安装 posgresql
  • 使用 mysql 数据库来尝试它是否适用于此项目(是)
  • 完全重新安装php、nginx、升级brew、composer等
  • 已启用 pdo_pgsql 和 pgsql 扩展(版本 15.3)

The good news is that i can work on my laravel projects using php artisan serve. But with the good old Valet i can't.

感谢您的任何想法

最佳答案

自从他们刚刚发布了支持 Postgresql 的新版本以来,它现在运行得很好。

https://twitter.com/marcelpociot/status/1683462872007954435

New extension: @laravelphp Herd now comes with Postgresql support 🎉 Just update the PHP version via the "Settings" screen.

但郑重声明,我从未能够使用 postgresql 让我的代客站点再次正常工作。

关于php - 安装 Herd 并返回 Valet 后为 502,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76735276/

相关文章:

php - php fmod 函数和算术 % 运算符之间的区别

php - 从 PHP 和 AJAX 获取结果

php - 尝试显示按钮时出错

mysql - Laravel:mysql 获取 json 中的所有未读和 15 个最后未读通知

php - 在 PostgreSQL 中获取 "ERROR: invalid input syntax for type double precision"

ruby-on-rails - 在 Rails 中重新创建表

php - 使用本地网络进行数据库连接

php - 如何在 nginx 配置中为一台主机设置 php ini 设置

javascript - 当用户升级时如何应用toastr?

ruby-on-rails - 创建关联对象 - Rails 4.2