PHP脚本替换cgi脚本
我有一个 CGI 脚本,它使用不再受支持的旧数据库驱动程序。我认为用 php 重写它会更容易,而不是苦苦挣扎这个旧的 cgi 脚本。它现在作为 php 脚本运行,但我需要从同一个网址提供它。当用户访问 http://somesite.com/myscript.cgi 时,我希望它运行php 脚本。我尝试用 .cgi 重命名 php 脚本,但这不起作用。这是在由 Dreamhost 托管的 Apache 服务器上。有什么建议吗?
- 布里杰·麦克斯韦
I have a CGI script that uses an old database driver that is no longer supported. Instead of struggling with this old cgi script, I thought it would be easier to rewrite it in php. It works now as a php script, but I need it to be served from the same web address. When a user accesses http://somesite.com/myscript.cgi, I want it to run the php script. I tried just renaming the php script with .cgi, but that didn't work. This is on an Apache server hosted by Dreamhost. Any advice?
- Bridger Maxwell
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建包含内容的
.htaccess
文件阅读有关 Mod_rewrite 和 示例
create
.htaccess
file with contentRead more about Mod_rewrite and examples