抓取外部php脚本并在本地服务器上运行 [英] Grab external php script and run on local server

查看:111
本文介绍了抓取外部php脚本并在本地服务器上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,专家,

php是否有可能在本地执行外部php脚本?
含义类似于include(外部脚本).

但是,这被认为是不安全的,因此我尝试使用Curl.但是我发现了
在显示之前,curl仍在外部服务器上运行脚本
在我的页面上.

有没有办法获取外部脚本(我不需要知道代码),
并在本地运行?

Brian

Hi experts,

is there a possibility in php, to execute an external php script locally?
Meaning something like include(external script).

This is deemed insecure however, and I tried using Curl. However I found
that curl still runs the script on the external server before displaying
on my page.

Is there any way to grab an external script(I don''t need to know the code),
and run it locally?

Brian

推荐答案

我不认为这是可能的-因为这样会暴露(其他)服务器端代码. CURL不起作用的原因是因为PHP正在处理请求并返回结果-就像在浏览器中一样.如果您没有对PHP文件的物理访问权限,则无法链接到该文件.

您是否需要公开可以利用的API?
I don''t believe this is possible - because it would then expose the (other) server side code. And the reason CURL isn''t working is because PHP is handling the request and returning the result - as it would do in a browser. If you do not have physical access to the PHP file, then you can not link to it.

Does whatever you need expose an API that you could may take advantage of?


这篇关于抓取外部php脚本并在本地服务器上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆