无法让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.

相关问答

更多

未声明绑定变量“D”(Bind variable “D” not declared)

问题在这里: 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 anony...

检查JavaScript变量是否曾经被声明过?(Check whether JavaScript variable has once been declared? [duplicate])

检查变量是否(本地)声明的唯一方法是测试该值,并查看是否引发了任何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 (...

XSLT:检查变量是否退出,是否已声明(XSLT: Check if variable exits, was declared)

你需要重新思考你的方法。 如果你有一个样式表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 styles...

检查d中函数(d){...}中的d是否有变量(Check if d has variable in function (d) {…} in D3)

您可以检查是否已定义属性。 如果有,它将使用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...

如何检查变量是否在D中声明?(How to check whether a variable is declared in D?)

那么,考虑到你的用例看起来是什么,你就会错误地解决它。 你真的应该做更多的事情 version(A) { immutable int var = 1; } else version(B) { immutable int var = 2; } else { immutable int var = 3; } 但在一般情况下,如果您正在专门测试符号是否存在,请使用is(typeof(symbol)) ,其中symbol是要测试的符号的名称。 所以,如果你想测试变量var是否存在...

如何检查变量是否在Python中声明?(How do I check whether a variable is declared in Python?)

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()

相关文章

更多

nginx基本运行命令

启动 [root@master local]# /usr/sbin/nginx -c/etc/ngin ...

PHP简介

PHP PHP是运行在服务器端的脚本,可以运行在UNIX、LINUX、WINDOWS、Mac OS下 ...

nginx开机启动

添加脚本文件 vim /etc/init.d/nginx 保存退出 [root@master ngin ...

Nginx配置文件详解

#user nobody; #运行用户 worker_processes 1; #启动进程,通常设 ...

nginx的平滑重启

在研发过程中,修改nginx的配置文件nginx.conf是很平常的事,需要重启nginx。如果我们直 ...

利用CoLinux在Windows中运行Linux系统

利用CoLinux在Windows中运行Linux系统的内容摘要:文/fromsx  出处/博客园1. ...

Working on Free Software

This was written in December, 1999 Lots of programm ...

php solr 扩展

安装php的solr扩展 下载地址: http://pecl.php.net/get/solr w ...

nginx下载与安装

下载 http://nginx.org/en/download.html 下载最新版本:nginx-1 ...

《微软Windows 8新特性和功能教程》(VTC.com Microsoft Windows 8 Introduction Course)[光盘镜像]

中文名: 微软Windows 8新特性和功能教程 英文名: VTC.com Microsoft ...

最新问答

更多

python的访问器方法有哪些

使用方法: class A(object): def foo(self,x): #类实例方法 print "executing foo(%s,%s)"%(self,x) @classmethod def class_foo(cls,x): #类方法 print "executing class_foo(%s,%s)"%(cls,x) @staticmethod def static_foo(x): #静态方法 print "executing static_foo(%s)"%x调用方法: a =

使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)

我认为你必须将两个TableGetway传递给UserTable构造。 你必须改变Module.php看看: public function getServiceConfig() { return array( 'factories' => array( 'User\Model\UserTable' => function($sm) { $userTableGateway = $sm->get('UserTable

透明度错误IE11(Transparency bug IE11)

这是一个渲染错误,由使用透明度触发,使用bootstrap用于在聚焦控件周围放置蓝色光环的box-shadow属性。 可以通过添加以下类覆盖来解决它。 .form-control:hover { -webkit-box-shadow: 0px 0px 5px 0px rgba(0,0,255,1); -moz-box-shadow: 0px 0px 5px 0px rgba(0,0,255,1); box-shadow: 0px 0px 4px 0px rgba(0,0,255,1)

linux的基本操作命令。。。

ls 显示目录 mkdir 建立目录 cd 进入目录

响应navi重叠h1和nav上的h1链接不起作用(Responsive navi overlaps h1 and navi links on h1 isn't working)

将z-index设置为.main-nav这将解决您的重叠问题 .main-nav { position:relative; z-index:9; } set z-index to .main-nav This will fix your overlaping issue .main-nav { position:relative; z-index:9; }

在C中读取文件:“r”和“a +”标志的不同行为(Reading a File in C: different behavior for “r” and “a+” flags)

这是因为模式规范"a"打开一个文件以便追加,文件指针在末尾。 如果您尝试从此处读取,则由于文件指针位于EOF,因此没有数据。 您应该打开"r+"进行阅读和写作。 如果在写入之前读取整个文件,则在写入更多数据时,文件指针将正确定位以追加。 如果这还不够,请探索ftell()和fseek()函数。 That is because the mode spec "a" opens a file for appending, with the file pointer at the end. If you

NFC提供什么样的带宽?(What Kind of Bandwidth does NFC Provide?)

支持空中接口的数据速率是一回事。 在消除协议开销,等待eeprom写入以及所有需要时间的其他内容之后,您看到的数据速率是完全不同的故事。 长话短说,从标签读取或进行对等传输时的实际数据速率峰值约为2.5千字节/秒。 取决于具体的标签或对等技术,它可能比这慢很多。 The supported data-rates of the air-interface are one thing. The data-rate that you see after removing protocol overhe

元素上的盒子阴影行为(box-shadow behaviour on elements)

它看起来像只在Windows上的Chrome的错误。 我在Google Canary (Chrome 63)中也进行了测试,问题依然存在,所以有可能它不会很快修复。 这个问题是由overflow: auto引起的overflow: auto ,在你的情况下,它可以很容易地通过删除或设置为可见(默认)来解决。 但是 ,将鼠标悬停在右侧(顶部和底部)时,会出现滚动条。 一个解决方案可以设置overflow: hidden的身体,所以预期的结果是所需的。 我想指出,这不是一个很好的解决方案,但我建议暂

Laravel检查是否存在记录(Laravel Checking If a Record Exists)

这取决于您是否要以后与用户合作,或仅检查是否存在。 如果要使用用户对象(如果存在): $user = User::where('email', '=', Input::get('email'))->first(); if ($user === null) { // user doesn't exist } 如果你只想检查 if (User::where('email', '=', Input::get('email'))->count() > 0) { // user found

设置base64图像的大小javascript - angularjs(set size of a base64 image javascript - angularjs)

$scope.getData= function () { var reader = new FileReader(); reader.onload = $('input[type=file]')[0].files; var img = new Image(); img.src =(reader.onload[0].result); img.onload = function() { if(this.width > 640