首页 \ 问答 \ Nginx PHP(5.5.1)FPM奇怪的错误(Nginx PHP (5.5.1) FPM strange errors)

Nginx PHP(5.5.1)FPM奇怪的错误(Nginx PHP (5.5.1) FPM strange errors)

目前我正在试验Nginx。 我使用通过repo安装的最新版本工作。 Nginx独立版一切正常。 然后我通过源代码安装PHP 5.5.1,我可以运行不同的版本,而不是生产webserver和php版本。 (为了测试目的,Nginx在另一个端口上运行,然后是80.)

一切都很顺利。 编译PHP 5.5.1没有错误,安装它,启动PHP-FPM并更改Nginx配置以在需要时调用PHP FPM。 我的第一个测试网站与此版本完美配合。 然后我试图运行我创建的另一个网站。 我只更改了文档根目录。

然后我得到了非常奇怪的错误:

PHP Fatal error:  Call to undefined function apache_request_headers() in [...]

是的,不是真正的错误......所以我删除了这个函数来测试网站是否能够在删除函数时顺利运行,这在PHP-FPM / FastCGI模式中是不可用的。

然后再次尝试时,日志中显示另一个错误:

PHP Parse error:  syntax error, unexpected ''INSERT ' (T_ENCAPSED_AND_WHITESPACE) in [...]

注释掉此变量(仅用于测试)后发生另一个错误:

PHP Parse error:  syntax error, unexpected end of file, expecting ')' in [...]

所以我不知道为什么会出现这两个错误。 第一个当然是改变了系统; 功能不可用。

所以我的主要问题是:为什么我的代码在FPM模式下使用PHP 5.5.1导致这些错误? 该网站完全适用于我的本地开发服务器(PHP 5.4和Apache)和生产服务器(Apache 2.2和PHP 5.4)...我没有更改代码(除了db等配置文件)。 有人知道会导致这个问题的原因吗?

如果您需要更多信息,请询问!

编辑:

错误1:

$sql = 'INSERT INTO ' . TABLE . ' 
(name) 
VALUES
("' . $name . '")
ON DUPLICATE KEY UPDATE name=VALUES(name)';

错误2:

'TEXT' => text::parse($row['text']),

At the moment I'm experimenting with Nginx. I got it working using the newest version installed via repo. Everything works fine with Nginx standalone. Then I installed PHP 5.5.1 via sources that I can run different versions and not affection the production webserver and php version. (Nginx was running on another port then 80 for testing purposes.)

Everything went fine. Compiled PHP 5.5.1 without errors, installed it, started PHP-FPM and changed the Nginx config to call PHP FPM when needed. My first test website worked perfectly with this version. Then I tried to get running another website I created. I've changed only the document root for that.

Then I got very strange errors:

PHP Fatal error:  Call to undefined function apache_request_headers() in [...]

Yes, not real an error... So I removed the function to test if the website works then smoothly when removing a function, which isn't available in PHP-FPM/FastCGI Mode.

Then another error showed in the logs when trying again:

PHP Parse error:  syntax error, unexpected ''INSERT ' (T_ENCAPSED_AND_WHITESPACE) in [...]

After commenting out this variable (only for testing) another error occured:

PHP Parse error:  syntax error, unexpected end of file, expecting ')' in [...]

So I don't know why those 2 errors occured. The first one is of course of the changed system; function not available.

So my main question is: Why is my code causing these errors with PHP 5.5.1 in FPM mode? The website works perfectly on my local dev server (PHP 5.4 and Apache) and production Server (Apache 2.2 and PHP 5.4)... I have NO code changed (except config files for db etc). So is someone knowing what can cause this issue?

If you need more information, just ask!

Edit:

Error 1:

$sql = 'INSERT INTO ' . TABLE . ' 
(name) 
VALUES
("' . $name . '")
ON DUPLICATE KEY UPDATE name=VALUES(name)';

Error 2:

'TEXT' => text::parse($row['text']),

原文:https://stackoverflow.com/questions/18218446
更新时间:2022-06-13 19:06

最满意答案

不要尝试将事件绑定到循环结构中。

尝试,

$(document).ready(function () {
    $('.top').on('click', function () {
        $('.read').not($('.read:eq(' + $('.top').index(this) + ')').slideToggle(300)).slideUp(300);
    });
});

DEMO


Don't try to bind events inside a loop structure.

Try,

$(document).ready(function () {
    $('.top').on('click', function () {
        $('.read').not($('.read:eq(' + $('.top').index(this) + ')').slideToggle(300)).slideUp(300);
    });
});

DEMO

相关问答

更多

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)