无法让Zorba使用PHP和Nginx在Windows 7上运行(Can't get Zorba working on Windows 7 with PHP and Nginx)
我试图在这些说明的帮助下在Windows 7机器上安装Zorba。 我已经完成了“验证Zorba”部分,但我无法完成“在PHP中启用Zorba扩展”部分。 当我尝试重启PHP时,弹出一个Windows对话框说;
我需要从源代码编译吗? 说明说从源代码编译Zorba,而是从Zorba下载页面下载了Windows安装包。 我还必须从源代码编译吗? 当然不是吗?
缺少zorba_api_wrapper.php说明说“找到文件zorba_api_wrapper.php”,但我找不到该名称的文件。 有一个名为zorba_api.php的文件,所以我用它来代替。 这是正确的文件吗?
php-cgi.exe我正在运行PHP的CGI版本。 我从命令提示符开始做;
php-cgi -b 127.0.0.1:9000
这可能是导致错误对话的原因吗? 我想让Apache启动PHP更常见。 (我使用的是Nginx而不是Apache。)
更新
正如Rodolfo所建议的那样,我已将
C:\Program Files\Zorba XQuery Processor 2.0.2\bin
到PATH
环境变量中并卸载了旧版本的Zorba。 现在,当我尝试通过执行来启动PHP时;php-cgi -b 127.0.0.1:9000
我得到一个不同的Windows对话框;
问题详细信息中的信息是;
Problem signature: Problem Event Name: APPCRASH Application Name: php-cgi.exe Application Version: 5.3.2.0 Application Timestamp: 4b8ec866 Fault Module Name: php5ts.dll Fault Module Version: 5.3.2.0 Fault Module Timestamp: 4b8ec7e7 Exception Code: c0000005 Exception Offset: 000f56c0 OS Version: 6.1.7601.2.1.0.768.3 Locale ID: 2057 Additional Information 1: 0a9e Additional Information 2: 0a9e372d3b4ad19135b953a78882e789 Additional Information 3: 0a9e Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
如果我从
php.ini
删除行extension=zorba_api.dll
,PHP启动正常。I'm trying to install Zorba on a Windows 7 machine with the help of these instructions. I've completed the "Verify Zorba" section ok, but I can't complete the section "Enable Zorba extension in PHP". When I attempt to restart PHP, a Windows dialog box pops up saying;
Do I need to compile from source? The instructions say to compile Zorba from source but instead have downloaded the Windows installation package from the Zorba download page. Do I also have to compile from source? Surely not?
Missing zorba_api_wrapper.php The instructions say "locate the file zorba_api_wrapper.php" but I can't find a file of that name. There is a file called zorba_api.php so I've used that instead. Is that the correct file?
php-cgi.exe I'm running the CGI version of PHP. I start it from the command prompt by doing;
php-cgi -b 127.0.0.1:9000
Could that be what's causing the error dialog? I guess it's more common to have Apache start PHP. (I'm using Nginx not Apache.)
Update
As suggested by Rodolfo, I've added
C:\Program Files\Zorba XQuery Processor 2.0.2\bin
to thePATH
environment variable and uninstalled an older version of Zorba. Now when I try to start PHP by doing;php-cgi -b 127.0.0.1:9000
I get a different Windows dialog;
The info in the Problem Details is;
Problem signature: Problem Event Name: APPCRASH Application Name: php-cgi.exe Application Version: 5.3.2.0 Application Timestamp: 4b8ec866 Fault Module Name: php5ts.dll Fault Module Version: 5.3.2.0 Fault Module Timestamp: 4b8ec7e7 Exception Code: c0000005 Exception Offset: 000f56c0 OS Version: 6.1.7601.2.1.0.768.3 Locale ID: 2057 Additional Information 1: 0a9e Additional Information 2: 0a9e372d3b4ad19135b953a78882e789 Additional Information 3: 0a9e Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
If I remove the line
extension=zorba_api.dll
fromphp.ini
, PHP starts ok.
原文:https://stackoverflow.com/questions/7650585
最满意答案
那么,考虑到你的用例看起来是什么,你就会错误地解决它。 你真的应该做更多的事情
version(A) { immutable int var = 1; } else version(B) { immutable int var = 2; } else { immutable int var = 3; }
但在一般情况下,如果您正在专门测试符号是否存在,请使用
is(typeof(symbol))
,其中symbol
是要测试的符号的名称。 所以,如果你想测试变量var
是否存在,你会做类似的事情static if(is(typeof(var))) { //var exists }
当然要测试它不存在,你只是否定了这个条件:
static if(!is(typeof(var))) { //var does not exist }
typeof(exp)
获取表达式的类型,如果表达式无效(由于变量不存在或者表达式中的函数不适用于这些参数或其他),则结果为void
。is(type)
检查类型是否void
。 因此,is(typeof(exp))
测试exp是否是一个有效的表达式,并且在它只是一个符号名称的情况下,这意味着它正在测试它是否是有效的符号。Well, given what your use case appears to be, you're going about it incorrectly. You really should do something more like
version(A) { immutable int var = 1; } else version(B) { immutable int var = 2; } else { immutable int var = 3; }
But in the general case, if you're looking specifically to test whether a symbol exists, use
is(typeof(symbol))
wheresymbol
is the name of the symbol that you're testing for. So, if you wanted to test whether the variablevar
existed, you would do something likestatic if(is(typeof(var))) { //var exists }
and of course to test that it doesn't exist, you just negate the condition:
static if(!is(typeof(var))) { //var does not exist }
typeof(exp)
gets the type of an expression, and if the expression is invalid (because of a variable which doesn't exist or a function in the expression doesn't work with those arguments or whatever), then the result isvoid
.is(type)
checks whether the type is non-void
. So,is(typeof(exp))
tests whether exp is a valid expression, and in the case where it's just a symbol name, that means that it's testing whether it's a valid symbol or not.
相关问答
更多-
用于学校教学的电脑网络教室,它的网络类型属于() A.互联网 B.广域网 C.城域网 D.局域网[2023-01-12]
d -
TCP/IP模型是一个________。[2023-05-19]
a -
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
未声明绑定变量“D”(Bind variable “D” not declared)[2022-06-16]
问题在这里: 67 END; 68 COMMIT; 你需要一行斜线来终止(和执行)匿名PL / SQL块,在END; (这是匿名块的第67行)和下一个语句COMMIT; 在这种情况下(它不是匿名块的一部分,所以在输出中也应该有它自己的SQL>提示符)。 The problem is here: 67 END; 68 COMMIT; You need a slash on a line on its own to terminate (and execute) the anonymous ... -
检查JavaScript变量是否曾经被声明过?(Check whether JavaScript variable has once been declared? [duplicate])[2022-04-29]
检查变量是否(本地)声明的唯一方法是测试该值,并查看是否引发了任何ReferenceError 。 try { a === 1; // Some statement to trigger a look-up for the a variable alert("a is declared!"); } catch (e) { alert("a is not declared!"); } The only way to check whether a variable is (local ... -
你需要重新思考你的方法。 如果你有一个样式表A有时导入B并且有时会导入C,那么你的做法是错误的:专用样式表模块应该导入通用模块。 You need to re-think your approach. If you have a stylesheet A that sometimes imports B and sometimes imports C, then you are doing things the wrong way round: the special-purpose stylesheet ...
-
您可以检查是否已定义属性。 如果有,它将使用text属性,否则将默认为percentage 。 .text(function (d) { return typeof(d.text) !== "undefined" ? d.text : d.percentage; }) 在下面的示例中, typeof(size_link_data[0].text)将为string而typeof(size_link_data[1].text)将返回undefined 。 var size_link_data = [{ ...
-
那么,考虑到你的用例看起来是什么,你就会错误地解决它。 你真的应该做更多的事情 version(A) { immutable int var = 1; } else version(B) { immutable int var = 2; } else { immutable int var = 3; } 但在一般情况下,如果您正在专门测试符号是否存在,请使用is(typeof(symbol)) ,其中symbol是要测试的符号的名称。 所以,如果你想测试变量var是否存在,你会做类 ...
-
dir()命令提供全局命名空间中所有变量的列表。 如果您的变量是x_val ,请使用 'x_val' in dir() The dir() command gives a list of all the variables in your global namespace. If your variable is x_val, use 'x_val' in dir()