我如何使用xdebug跟踪我的卷曲(How can I track my curl with xdebug)
我试图用崇高的Xdebug,这是工作。 我想跟踪我的卷曲代码,例如:
我打开了一个URL
http://localhost:8001/test/show
,这是我在test.php
文件中的断点,它是可行的。 在test.php
我使用curl
来调用http://localhost:8002/api/show
并且我想在api.php
文件中添加断点,但它不适用于api.php
。 我该怎么做? 谢谢。I had tried to use Xdebug with sublime, it's work. And I want to track my curl code, for example:
I opened a URL
http://localhost:8001/test/show
, my breakpoint at thetest.php
file, it's work. And in thetest.php
I usecurl
to callhttp://localhost:8002/api/show
and I want to add the breakpoint atapi.php
file, but it does not work on theapi.php
. How can I do it? thanks.
原文:https://stackoverflow.com/questions/33953859
最满意答案
那么,你可以尝试:
#define system DontEvenThinkAboutUsingThisFunction #define exec OrThisOneYouClown
在一个头文件中,但我非常确定任何值得他们的盐的代码猴可以绕过这样的“保护”。
我有兴趣了解为什么你认为这是必要的(如果我们更好地理解问题,可能会有更好的解决方案)。
唯一想到的是,你想提供一些类似于Euler项目的在线编译器/ runner。 如果是这样的话,那么你可以搜索字符串
system<whitespace>(
的代码system<whitespace>(
作为一个选项,但即使如此,一个确定的派对可能只是:#define InoccuousFunction system
绕过你的防御。
如果是这样的话,你可能要考虑使用类似
chroot
东西,这样任何人都无法访问任何危险的二进制文件,如shutdown
(并且该特定的野兽不应该由普通用户真正运行) - 在换句话说,限制他们的环境,使他们唯一可以看到的东西是gcc
和它的亲属。你需要做适当的沙盒,因为即使你以某种方式阻止他们运行外部程序,他们仍然可以做一些危险的事情,比如overwite文件或者打开套接字连接到他们自己的盒子,通过你的珍贵信息的内容发送。
Well, you could try:
#define system DontEvenThinkAboutUsingThisFunction #define exec OrThisOneYouClown
in a header file but I'm pretty certain any code monkey worth their salt could bypass such a "protection".
I'd be interested in understanding why you thought this was necessary (there may be a better solution if we understood the problem better).
The only thing that comes to mind is that you want to provide some online compiler/runner akin to the Euler project. If that was the case, then you could search the code for the string
system<whitespace>(
as an option but, even then, a determined party could just:#define InoccuousFunction system
to get around your defenses.
If that is the case, you might want to think about using something like
chroot
so that no-one can even get access to any dangerous binaries likeshutdown
(and that particular beast shouldn't really be runnable by a regular user anyway) - in other words, restrict their environment so that the only things they can even see aregcc
and its kin.You need to do proper sandboxing since, even if you somehow prevented them from running external programs, they may still be able to do dangerous things like overwite files or open up socket connections to their own box to send through the contents of your precious information.
相关问答
更多-
看这个 HDC hDC = GetDC(g_hWnd); LPRECT rect = (LPRECT)malloc(sizeof(RECT)); GetWindowRect(g_hWnd,rect); int h = rect->right - rect->left; int w = rect->bottom - rect->top; LPRECT rect = (LPRECT)malloc(sizeof(RECT)); GetWindowRect(g_hWnd,rect); HBITMAP ...
-
它是原始的ANSI C之前的版本,如K&R1(Kernighan和Ritchie的“C编程语言”的原始版本所示。所谓的“原始”或前ANSI C编译器使用了这种语法。一些现代编译器可以被调用,所以他们将使用命令行选项接受这种类型的代码。 从那以后,C已经发展了很长的路,但是你仍然会在较旧的程序中遇到它。 It's original pre-ANSI C, like shown in K&R1 (the original edition of "The C Programming Language" by Ke ...
-
为什么C中的PAINTSTRUCT是PASCAL中的TpaintStruct?(Why PAINTSTRUCT in C is TpaintStruct in PASCAL?)[2023-09-14]
Delphi(以及之前的Turbo Pascal,IIRC)一直有使用T前缀类型的自定义,如TStringList , TButton , TCustomForm , TDateTime等。 您可以在Windows.pas单元中找到为您声明的TTextMetric (和TPaintStruct ),以及许多标准的WinAPI函数。 ( WinTypes , WinTypes已被弃用。对于16位应用程序来说,它是Delphi 1的旧版遗留物,在Delphi的更高版本中会被Windows自动替换。) Delph ... -
最简单的机制是创建一个pascal Static Library并将其包含在Objective-C iOS项目中,否则你必须将构建过程集成到xcode环境中; 这是一个更多的工作,而不是通过标题暴露API,然后链接到.a文件。 The simplest mechanism is to create a pascal Static Library and include it in the Objective-C iOS project, otherwise you would have to integra ...
-
Pascal中的BigInteger(BigInteger in Pascal)[2023-04-30]
您将在此Lazarus论坛主题和此处找到一些不同的解决方案。 You will find a few different solutions in this Lazarus forum thread and here. -
在Pascal中调用方法(Invoke methods in Pascal)[2023-05-30]
你不能直接和便携地从Pascal调用C ++方法。 如果您的回调函数是C ++对象,请忘记它。 否则填充TMethod对象并将其转换为正确的“对象过程”声明。 不要忘记调用约定。 对于更奇怪的解决方案,您可能需要查看(RemObjects')Pascalscript。 Ps这是相同的,你甚至无法从另一个C ++编译器可靠地调用C ++方法。 它不是Pascal vs C ++本身。 You cannot directly and portably call a C++ method from Pascal. ... -
我认为你混合动态数组和开放数组。 其中措词相同,但在不同的情况下。 http://rvelthuis.de/articles/articles-openarr.html 尝试这个: type TPAnsiCharDynArray = array of PAnsiChar; function callPluginFunction(plugin, method: PAnsiChar; synchronous :boolean; param: array of PAnsiChar; ...
-
C和C样式字符串中的Pascal样式字符串在一个函数中进行比较(Pascal style string in C and C style string compare in one function)[2023-05-28]
好吧,这样的事情? int compare(unsigned char *pascal, unsigned char *str, unsigned int strLength) { unsigned int length = pascal[0];// get length of pascal string if(length != strLength) return 0; // if strings have different length no need to compa ... -
c中的exec函数未运行(Exec function in c is not running)[2023-03-16]
在评论中,您提到将counter.c编译为名为a.out的可执行文件。 如果未向编译器显式提供输出名称,那么这是缺省可执行文件名。 因此,如果您同时编译counter.c和main.c ,则只有其中一个是a.out 。 您可以为gcc提供一个选项,命名您的可执行文件与默认值不同: gcc -o counter counter.c 另外,你对execl的调用并不完全正确。 第一个参数是可执行文件的路径,但其余参数将变为argv[0] , argv[1]等。因此,您真的想以这种方式调用execl : ... -
那么,你可以尝试: #define system DontEvenThinkAboutUsingThisFunction #define exec OrThisOneYouClown 在一个头文件中,但我非常确定任何值得他们的盐的代码猴可以绕过这样的“保护”。 我有兴趣了解为什么你认为这是必要的(如果我们更好地理解问题,可能会有更好的解决方案)。 唯一想到的是,你想提供一些类似于Euler项目的在线编译器/ runner。 如果是这样的话,那么你可以搜索字符串system
(的代 ...