我对 php5-fpm 有疑问。通常它会出现段错误并阻止整个 php 处理,因此不会向客户端提供任何答案。 对我来说,回溯看起来像一个无限循环,但我看不出它是由脚本还是内部 php 模块引起的。
是否有机会查看涉及哪个脚本/模块?
段错误总是看起来像那样(dmesg 输出):
php5-fpm[1858]: segfault at 7fffa4de4fa0 ip 0000000000691515 sp 00007fffa4de4f90 error 6 in php5-fpm[400000+800000]
PHP 版本:
php -v
PHP 5.5.9-1ubuntu4.11 (cli) (built: Jul 2 2015 15:23:08)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
Coredump 回溯:
(gdb) bt
#0 0x0000000000691515 in ?? ()
#1 0x0000000000692a64 in vspprintf ()
#2 0x0000000000707359 in zend_spprintf ()
#3 0x00000000006e4a46 in _convert_to_string ()
#4 0x0000000000725859 in ?? ()
#5 0x0000000000717668 in execute_ex ()
#6 0x00000000006dd7c9 in dtrace_execute_ex ()
#7 0x000000000079df80 in ?? ()
#8 0x0000000000717668 in execute_ex ()
#9 0x00000000006dd7c9 in dtrace_execute_ex ()
#10 0x000000000079df80 in ?? ()
#11 0x0000000000717668 in execute_ex ()
#12 0x00000000006dd7c9 in dtrace_execute_ex ()
#13 0x000000000079df80 in ?? ()
#14 0x0000000000717668 in execute_ex ()
#15 0x00000000006dd7c9 in dtrace_execute_ex ()
#16 0x000000000079df80 in ?? ()
#17 0x0000000000717668 in execute_ex ()
#18 0x00000000006dd7c9 in dtrace_execute_ex ()
#19 0x000000000079df80 in ?? ()
#20 0x0000000000717668 in execute_ex ()
#21 0x00000000006dd7c9 in dtrace_execute_ex ()
#22 0x000000000079df80 in ?? ()
#23 0x0000000000717668 in execute_ex ()
#24 0x00000000006dd7c9 in dtrace_execute_ex ()
#25 0x000000000079df80 in ?? ()
#26 0x0000000000717668 in execute_ex ()
#27 0x00000000006dd7c9 in dtrace_execute_ex ()
#28 0x000000000079df80 in ?? ()
#29 0x0000000000717668 in execute_ex ()
#30 0x00000000006dd7c9 in dtrace_execute_ex ()
#31 0x000000000079df80 in ?? ()
#32 0x0000000000717668 in execute_ex ()
#33 0x00000000006dd7c9 in dtrace_execute_ex ()
#34 0x000000000079df80 in ?? ()
#35 0x0000000000717668 in execute_ex ()
#36 0x00000000006dd7c9 in dtrace_execute_ex ()
#37 0x000000000079df80 in ?? ()
#38 0x0000000000717668 in execute_ex ()
#39 0x00000000006dd7c9 in dtrace_execute_ex ()
#40 0x000000000079df80 in ?? ()
#41 0x0000000000717668 in execute_ex ()
#42 0x00000000006dd7c9 in dtrace_execute_ex ()
#43 0x000000000079df80 in ?? ()
#44 0x0000000000717668 in execute_ex ()
#45 0x00000000006dd7c9 in dtrace_execute_ex ()
#46 0x000000000079df80 in ?? ()
(...)
#68150 0x0000000000717668 in execute_ex ()
#68151 0x00000000006dd7c9 in dtrace_execute_ex ()
#68152 0x000000000079df80 in ?? ()
#68153 0x0000000000717668 in execute_ex ()
#68154 0x00000000006dd7c9 in dtrace_execute_ex ()
#68155 0x000000000079df80 in ?? ()
#68156 0x0000000000717668 in execute_ex ()
#68157 0x00000000006dd7c9 in dtrace_execute_ex ()
#68158 0x000000000079cec1 in ?? ()
#68159 0x0000000000717668 in execute_ex ()
#68160 0x00000000006dd7c9 in dtrace_execute_ex ()
#68161 0x00000000006ef250 in zend_execute_scripts ()
#68162 0x000000000068f065 in php_execute_script ()
#68163 0x0000000000463b00 in main ()
回溯获取文件名:
(gdb) print (char *)executor_globals.active_op_array->filename
Attempt to extract a component of a value that is not a structure.
已安装的包:
dpkg -l | grep php
ii php5-apcu 4.0.2-2build1 amd64 APC User Cache for PHP 5
ii php5-cli 5.5.9+dfsg-1ubuntu4.11 amd64 command-line interpreter for the php5 scripting language
ii php5-common 5.5.9+dfsg-1ubuntu4.11 amd64 Common files for packages built from the php5 source
ii php5-curl 5.5.9+dfsg-1ubuntu4.11 amd64 CURL module for php5
ii php5-fpm 5.5.9+dfsg-1ubuntu4.11 amd64 server-side, HTML-embedded scripting language (FPM-CGI binary)
ii php5-gd 5.5.9+dfsg-1ubuntu4.11 amd64 GD module for php5
ii php5-json 1.3.2-2build1 amd64 JSON module for php5
ii php5-mcrypt 5.4.6-0ubuntu5 amd64 MCrypt module for php5
ii php5-mysqlnd 5.5.9+dfsg-1ubuntu4.11 amd64 MySQL module for php5 (Native Driver)
ii php5-readline 5.5.9+dfsg-1ubuntu4.11 amd64 Readline module for php5
最佳答案
APC 与 PHP 5.5 兼容。你应该禁用它。但是包含 Opcache,因此您可以改用它。我不确定这是否能解决您的问题,但很可能是罪魁祸首。
还有其他一些可能有帮助的事情 - 什么时候发生段错误?流程什么时候开始?还是在提出请求时?
关于PHP-FPM 段错误 6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32167132/
大约一年前,我决定确保每个包含非唯一文本的Flash通知都将从模块中的方法中获取文本。我这样做的最初原因是为了避免一遍又一遍地输入相同的字符串。如果我想更改措辞,我可以在一个地方轻松完成,而且一遍又一遍地重复同一件事而出现拼写错误的可能性也会降低。我最终得到的是这样的:moduleMessagesdefformat_error_messages(errors)errors.map{|attribute,message|"Error:#{attribute.to_s.titleize}#{message}."}enddeferror_message_could_not_find(obje
我遵循MichaelHartl的“RubyonRails教程:学习Web开发”,并创建了检查用户名和电子邮件长度有效性的测试(名称最多50个字符,电子邮件最多255个字符)。test/helpers/application_helper_test.rb的内容是:require'test_helper'classApplicationHelperTest在运行bundleexecraketest时,所有测试都通过了,但我看到以下消息在最后被标记为错误:ERROR["test_full_title_helper",ApplicationHelperTest,1.820016791]test
我是rails的新手,想在form字段上应用验证。myviewsnew.html.erb.....模拟.rbclassSimulation{:in=>1..25,:message=>'Therowmustbebetween1and25'}end模拟Controller.rbclassSimulationsController我想检查模型类中row字段的整数范围,如果不在范围内则返回错误信息。我可以检查上面代码的范围,但无法返回错误消息提前致谢 最佳答案 关键是您使用的是模型表单,一种显示ActiveRecord模型实例属性的表单。c
我正在尝试编写一个将文件上传到AWS并公开该文件的Ruby脚本。我做了以下事情:s3=Aws::S3::Resource.new(credentials:Aws::Credentials.new(KEY,SECRET),region:'us-west-2')obj=s3.bucket('stg-db').object('key')obj.upload_file(filename)这似乎工作正常,除了该文件不是公开可用的,而且我无法获得它的公共(public)URL。但是当我登录到S3时,我可以正常查看我的文件。为了使其公开可用,我将最后一行更改为obj.upload_file(file
我克隆了一个rails仓库,我现在正尝试捆绑安装背景:OSXElCapitanruby2.2.3p173(2015-08-18修订版51636)[x86_64-darwin15]rails-v在您的Gemfile中列出的或native可用的任何gem源中找不到gem'pg(>=0)ruby'。运行bundleinstall以安装缺少的gem。bundleinstallFetchinggemmetadatafromhttps://rubygems.org/............Fetchingversionmetadatafromhttps://rubygems.org/...Fe
在Cooper的书BeginningRuby中,第166页有一个我无法重现的示例。classSongincludeComparableattr_accessor:lengthdef(other)@lengthother.lengthenddefinitialize(song_name,length)@song_name=song_name@length=lengthendenda=Song.new('Rockaroundtheclock',143)b=Song.new('BohemianRhapsody',544)c=Song.new('MinuteWaltz',60)a.betwee
我是Google云的新手,我正在尝试对其进行首次部署。我的第一个部署是RubyonRails项目。我基本上是在关注thisguideinthegoogleclouddocumentation.唯一的区别是我使用的是我自己的项目,而不是他们提供的“helloworld”项目。这是我的app.yaml文件runtime:customvm:trueentrypoint:bundleexecrackup-p8080-Eproductionconfig.ruresources:cpu:0.5memory_gb:1.3disk_size_gb:10当我转到我的项目目录并运行gcloudprevie
我有两个Rails模型,即Invoice和Invoice_details。一个Invoice_details属于Invoice,一个Invoice有多个Invoice_details。我无法使用accepts_nested_attributes_forinInvoice通过Invoice模型保存Invoice_details。我收到以下错误:(0.2ms)BEGIN(0.2ms)ROLLBACKCompleted422UnprocessableEntityin25ms(ActiveRecord:4.0ms)ActiveRecord::RecordInvalid(Validationfa
这个问题在这里已经有了答案:Arraysmisbehaving(1个回答)关闭6年前。是否应该这样,即我误解了,还是错误?a=Array.new(3,Array.new(3))a[1].fill('g')=>[["g","g","g"],["g","g","g"],["g","g","g"]]它不应该导致:=>[[nil,nil,nil],["g","g","g"],[nil,nil,nil]]
尝试在我的RoR应用程序中实现计数器缓存列时出现错误Unknownkey(s):counter_cache。我在这个问题中实现了模型关联:Modelassociationquestion这是我的迁移:classAddVideoVotesCountToVideos0Video.reset_column_informationVideo.find(:all).eachdo|p|p.update_attributes:videos_votes_count,p.video_votes.lengthendenddefself.downremove_column:videos,:video_vot