首页 \ 问答 \ 无法让Zorba使用PHP和Nginx在Windows 7上运行(Can't get Zorba working on Windows 7 with PHP and Nginx)

无法让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对话框说;

php-cgi.exe错误

需要从源代码编译吗? 说明说从源代码编译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\binPATH环境变量中并卸载了旧版本的Zorba。 现在,当我尝试通过执行来启动PHP时;

php-cgi -b 127.0.0.1:9000

我得到一个不同的Windows对话框;

Zorba Crash

问题详细信息中的信息是;

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;

php-cgi.exe error

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 the PATH 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;

Zorba Crash

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 from php.ini, PHP starts ok.


原文:https://stackoverflow.com/questions/7650585
更新时间:2024-04-21 11:04

最满意答案

那么,考虑到你的用例看起来是什么,你就会错误地解决它。 你真的应该做更多的事情

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)获取表达式的类型,如果表达式无效(由于变量不存在或者表达式中的函数不适用于这些参数或其他),则结果为voidis(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)) where symbol is the name of the symbol that you're testing for. So, if you wanted to test whether the variable var existed, you would do something like

static 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 is void. 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.

相关问答

更多

相关文章

更多

最新问答

更多
  • 带有简单redis应用程序的Node.js抛出“未处理的错误”(Node.js with simple redis application throwing 'unhandled error')
  • 高考完可以去做些什么?注意什么?
  • Allauth不会保存其他字段(Allauth will not save additional fields)
  • Flask中的自定义中止映射/异常(Custom abort mapping/exceptions in Flask)
  • sed没有按预期工作,从字符串中间删除特殊字符(sed not working as expected, removing special character from middle of string)
  • 怎么在《我的世界》游戏里面编程
  • .NET可移植可执行文件VS .NET程序集(.NET Portable Executable File VS .NET Assembly)
  • 搜索字符串从视图中键入两个字段的“名字”和“姓氏”组合(Search Strings Typed from View for Two Fields 'First Name' and 'Last Name' Combined)
  • 我可以通过配置切换.Net缓存提供程序(Can I switch out .Net cache provider through configuration)
  • 在鼠标悬停或调整浏览器大小之前,内容不会加载(Content Does Not Load Until Mouse Hover or Resizing Browser)
  • 未捕获的TypeError:auth.get不是函数(Uncaught TypeError: auth.get is not a function)
  • 如何使用变量值创建参数类(How to create a parameter class with variant value)
  • 在std :: deque上并行化std :: replace(Parallelizing std::replace on std::deque)
  • 单元测试返回Connection对象的方法(Unit Test for a method that returns a Connection object)
  • rails:上传图片时ios中的服务器内部错误(rails: server internal error in ios while uploading image)
  • 如何在Android中构建应用程序警报[关闭](How build an application Alarm in Android [closed])
  • 以编程方式连接到Windows Mobile上的蓝牙耳机(Programmatically connect to bluetooth headsets on Windows Mobile)
  • 在两个不同的SharedPreference中编写并获得相同的结果(Writing in two different SharedPreference and getting the same result)
  • CSS修复容器和溢出元素(CSS Fix container and overflow elements)
  • 在'x','y','z'迭代上追加数组(Append array on 'x', 'y', 'z' iteration)
  • 我在哪里可以看到使用c ++源代码的UML方案示例[关闭](Where I can see examples of UML schemes with c++ source [closed])
  • SQL多个连接在与where子句相同的表上(SQL Multiple Joins on same table with where clause)
  • 位字段并集的大小,其成员数多于其大小(Size of bit-field union which has more members than its size)
  • 我安装了熊猫,但它不起作用(I installed pandas but it is not working)
  • Composer - 更改它在env中使用的PHP版本(Composer - Changing the version of PHP it uses in the env)
  • 使用JavaFX和Event获取鼠标位置(Getting a mouse position with JavaFX and Event)
  • 函数调用可以重新排序(Can function calls be reordered)
  • 关于“一对多”关系的NoSQL数据建模(NoSQL Data Modeling about “one to many” relationships)
  • 如何解释SBT错误消息(How to interpret SBT error messages)
  • 调试模式下的Sqlite编译器错误“初始化程序不是常量”(Sqlite compiler errors in Debug mode “initializer is not a constant”)