---
canonical: https://meta.cyberforums.com/t/golang/2755
webpage: https://cravatar.com/forums/t/2755-golang/
language: zh-Hans
---

# 与自有程序集成页面希望增加Golang语言的案例

> 初认头像支持论坛的只读副本。
> 讨论原文：https://meta.cyberforums.com/t/golang/2755
> 网页版：https://cravatar.com/forums/t/2755-golang/

## 1 · 1835038031

- 发布时间：2024年11月6日 13:50

如题，为此我写了一个示例程序，以供参考：

https://gist.github.com/okatu-loli/7c29848f5069fdc31fd38e82a6ff143a


归档迁移自原 Cravatar 社区（原版块：基础设施 · 原发布时间：2024-11-06）

## 2 · 壳壳虫

- 发布时间：2024年11月6日 13:50

您可以使用PHP的exec函数来调用Golang程序。首先，确保您的服务器上已经安装了Golang，并且您的PHP代码有权限执行Golang程序。然后，您可以通过以下方式在PHP中调用Golang程序：
$output = shell_exec('/path/to/your/golang/program'); echo $output;

在这个例子中，/path/to/your/golang/program应该替换为您实际的Golang程序的路径。当您调用shell_exec函数时，它会执行Golang程序并返回输出结果，您可以根据需要对输出进行处理或显示。
以上由壳壳虫自动解答供参考，您可以继续跟帖或等待人工回复。

## 3 · 莫蒂奇

- 发布时间：2024年11月27日 13:59

已经添加，感谢提供
https://cravatar.com/developer/go-image-requests
