-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
502 error with Phalcon 2.0 on Nginx and PHP 5.6, Ubuntu x64 14.04 #2761
Comments
@Swader you can move into index file, then running
|
As @duythien said: cd /path/to/website/public
gdb php
run index.php
bt full |
This is the output:
|
It seems you have to compile Phalcon in debug mode, please compile it as follows: git clone http://github.com/phalcon/cphalcon
git checkout 2.0.0
cd ext
sudo ./install-test |
@phalcon done and rebooted it all, but the result is exactly the same on all fronts. Where should I be seeing some more information about problems? |
Could you try compiling again? Please pull changes down from the 2.0.0 branch |
This makes me feel much better, because I am getting the same thing, but running v5.5.16 in my local Homestead environment. Thought I was just an idiot! Was going to try and run the tests on the v2 branch and got this output... vagrant@homestead:/vagrant/cphalcon/php-tests/tests$ phpunit
PHPUnit 4.1.3 by Sebastian Bergmann.
Configuration read from /vagrant/cphalcon/php-tests/tests/phpunit.xml
................Segmentation fault (core dumped) At which point, I tried loading up a local phalcon project and saw the 502 error. I do not have gdb installed, so... cannot confirm my output to @Swader's. I will also add, when compiling Phalcon v2.0.0 branch, with Zephir, I this is the output... Warning: Class "APCIterator" does not exist at compile time in /vagrant/cphalco
n/phalcon/cache/backend/apc.zep on 222 [nonexistent-class]
apc = new \APCIterator("user", prefixPattern);
------------------------------------------------^
Warning: Unreachable code in /vagrant/cphalcon/phalcon/dispatcher.zep on 581 [un
reachable-code]
if typeof eventsManager == "object" {
---------------------------------------^
Warning: Unreachable code in /vagrant/cphalcon/phalcon/dispatcher.zep on 596 [un
reachable-code]
if method_exists(handler, "afterExecuteRoute") {
--------------------------------------------------^
Warning: Possible attempt to use non-object in "new" operator in /vagrant/cphalc
on/phalcon/mvc/model.zep on 584 [non-valid-new]
let hydrate = new \stdclass();
--------------------------------^
Warning: Variable "columnMap" declared but not used in Phalcon\Mvc\Model\MetaDat
a::_initialize in /vagrant/cphalcon/phalcon/mvc/model/metadata.zep on 94 [unused
-variable]
dependencyInjector, columnMap, keyName, prefixKey;
--------------------------------^
Warning: Function "phalcon_orm_singlequotes" does not exist at compile time in /
vagrant/cphalcon/phalcon/mvc/model/query.zep on 511 [nonexistent-function]
let escapedValue = phalcon_orm_singlequotes(value);
---------------------------------------------------------^
Warning: Variable 'sqlJoinConditions' was assigned for the first time in conditi
onal branch, consider initialize it at its declaration in /vagrant/cphalcon/phal
con/mvc/model/query.zep on 935 [conditional-initialization]
];
--^
Compiling...
Installing...
Extension installed!
Don't forget to restart your web server The second warning is a bit troubling, since it deals with the @Swader, do you see the same warnings when compiling Phalcon? @phalcon I added the cphalcon repo as an upstream remote, just now, and it states, when performing Output of \vagrant@homestead:/vagrant/cphalcon$ git pull upstream 2.0.0
From https://github.com/phalcon/cphalcon
* branch 2.0.0 -> FETCH_HEAD
Already up-to-date. Hope that I did not induce information overload... :( |
@unisys12 Please try running the tests with $ phpunit --debug |
Sorry for the delay... Here is the output at the line of the segfault Starting test 'Phalcon\Test\Http\Request\UnitTest::testInput'.
Segmentation fault (core dumped) |
It's passing on my machine: $ phpunit --debug
PHPUnit 4.2.0 by Sebastian Bergmann.
Configuration read from /home/andres/cphalcon/php-tests/tests/phpunit.xml
Starting test 'Phalcon\Test\Escaper\UnitTest::testEscapeHtml'.
.
Starting test 'Phalcon\Test\Acl\Resource\UnitTest::testAclResourceName'.
.
Starting test 'Phalcon\Test\Acl\Resource\UnitTest::testAclResourceNameDescription'.
.
Starting test 'Phalcon\Test\Acl\Role\UnitTest::testAclRoleNameEmptyDescription'.
.
Starting test 'Phalcon\Test\Acl\Role\UnitTest::testAclRoleNameDescription'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testInstanceOf'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testHeaderGetEmpty'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testHeaderGet'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testIsAjaxDefault'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testIsAjax'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testGetSchemeDefault'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testGetScheme'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testIsSecureRequestDefault'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testIsSecureRequest'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testGetServerAddressDefault'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testGetServerAddress'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testInput'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testHttpHost'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testMethod'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testAcceptableContent'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testAcceptableCharsets'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testAcceptableLanguage'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testClientAddress'.
.
Starting test 'Phalcon\Test\Security\UnitTest::testHash'.
.
Time: 5.79 seconds, Memory: 3.25Mb
OK (24 tests, 86 assertions) Anyway I can access your machine? |
I don't know. Might be able to do something over on a G+ hang or some thing. Let me try bring up a new environment and starting from scratch. Maybe do something outside of Homestead, maybe use Puphpet to quickly get something up and running. I will let you know then, if I cannot isolate this issue further. I would like to prove or disprove weather @Swader and I both have the same issue. Since he and I both are Homestead users, I think it would be best if I explore that first. Well let you know |
I'll try to set up a Vagrant machine with Phalcon 2 as the article describes |
After pulling the latest changes and recompiling without zephir, as you described above, with install-test, everything seems to be working fine. Tests in the php-tests/tests folder of cphalcon are passing, too. |
@unisys12 did you try the new version? Does it work for you too now? |
@Swader No, unfortunately it did not resolve my issue. So I think we may be experiencing different issues. They may lead to same end 502 error page but different cause. I made a fresh clone into an existing One thing that I did find was: When instantiating a micro app, as long as I do not config a view and return items directly from a closure, everything seemingly works fine. Similar to this thread on the forums - http://forum.phalconphp.com/discussion/3297/php-5-6-0-gives-an-error-get-failed-net-err-empty-response- |
How about if you follow the instructions from the article in the original |
@Swader Nope, do dice. I installed gdb and took a stab at what @phalcon and @duythien was working towards earlier in your issue. This was the output (gdb) run index.php
Starting program: /usr/bin/php index.php
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe9ded700 (LWP 4321)]
[Thread 0x7fffe9ded700 (LWP 4321) exited]
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5088b77 in xdebug_build_fname (edata=0x7fffffffa630, tmp=0x13cbe30)
at /build/buildd/xdebug-2.2.5/xdebug-2.2.5/xdebug_stack.c:918
918 /build/buildd/xdebug-2.2.5/xdebug-2.2.5/xdebug_stack.c: No such file or
directory.
(gdb) bt full
#0 0x00007ffff5088b77 in xdebug_build_fname (edata=0x7fffffffa630,
tmp=0x13cbe30)
at /build/buildd/xdebug-2.2.5/xdebug-2.2.5/xdebug_stack.c:918
fname = 0x7fffffffccdf ""
#1 xdebug_add_stack_frame (zdata=zdata@entry=0x7fffffffa630, op_array=0x0,
type=type@entry=1)
at /build/buildd/xdebug-2.2.5/xdebug-2.2.5/xdebug_stack.c:1039
edata = 0x7fffffffa630
opline_ptr = 0x7ffff7fa9320
tmp = 0x13cbe30
cur_opcode = <optimized out>
param = <optimized out>
i = 0
aggr_key = 0x0
aggr_key_len = 0
#2 0x00007ffff5079534 in xdebug_execute_internal (
current_execute_data=0x7fffffffa630, fci=0x7fffffffa7b0,
return_value_used=1)
at /build/buildd/xdebug-2.2.5/xdebug-2.2.5/xdebug.c:1520
edata = 0x7fffffffa630
fse = <optimized out>
cur_opcode = <optimized out>
do_return = 0
function_nr = 0
restore_error_handler_situation = 0
tmp_error_cb = 0x0
#3 0x00000000006c348b in zend_call_function ()
No symbol table info available.
#4 0x00007fffeaae8b19 in zephir_call_user_function ()
from /usr/lib/php5/20121212/phalcon.so
No symbol table info available.
#5 0x00007fffeaaf06af in zephir_call_func_aparams ()
from /usr/lib/php5/20121212/phalcon.so
No symbol table info available.
#6 0x00007fffeaae2295 in zim_Phalcon_Mvc_Micro_handle ()
from /usr/lib/php5/20121212/phalcon.so
No symbol table info available.
#7 0x00000000006c10fb in dtrace_execute_internal ()
No symbol table info available.
#8 0x00007ffff50795e6 in xdebug_execute_internal (
current_execute_data=0x7ffff7fa9320, fci=0x0, return_value_used=0)
at /build/buildd/xdebug-2.2.5/xdebug-2.2.5/xdebug.c:1551
edata = <optimized out>
fse = 0x13cb9b0
cur_opcode = <optimized out>
do_return = 0
function_nr = 71
restore_error_handler_situation = 0
---Type <return> to continue, or q <return> to quit---
tmp_error_cb = <optimized out>
#9 0x00000000007816d5 in ?? ()
No symbol table info available.
#10 0x00000000006fb3a8 in execute_ex ()
No symbol table info available.
#11 0x00000000006c0ff9 in dtrace_execute_ex ()
No symbol table info available.
#12 0x00007ffff5078b6c in xdebug_execute_ex (execute_data=0x7ffff7fa9320)
at /build/buildd/xdebug-2.2.5/xdebug-2.2.5/xdebug.c:1437
op_array = 0x7ffff7fdc588
edata = <optimized out>
dummy = 0xe5e828 <compiler_globals+392>
fse = 0x13c67b0
xfse = <optimized out>
magic_cookie = <optimized out>
do_return = 0
function_nr = 0
le = <optimized out>
clear = 1
return_val = 0x0
#13 0x00000000006d2c60 in zend_execute_scripts ()
No symbol table info available.
#14 0x0000000000672875 in php_execute_script ()
No symbol table info available.
#15 0x00000000007836ae in ?? ()
No symbol table info available.
#16 0x00000000004605d0 in main ()
No symbol table info available. FIgure it would be best to get this info, because turning off Xdebug and installing in debug mode is not the way we want do things. Plus, others are going to have this issue as well. Getting info should at least help in researching the problem anyway. And to think I started out wanting to write a tutorial that might get others inspired to help with writing tests or using the output of tests to write code to fill holes in the code base. And here we are, learning about a whole lot more than I set out to in the first place. Makes things fun though! |
It looks like a xdebug bug, it assumes that |
@phalcon Well, there ya go! :) Will disable the xdebug extension in my environment tomorrow moring to make I do not have any other issues unrelated to this. |
Added a pull request on xdebug to fix the problem: xdebug/xdebug#120 |
I also have output some warning when build phalcon with zephir command :
|
yeah that's always there, nothing to worry about
|
As the same warning there.
|
@jtunggit I think you should install php-mcrypt and rebuild with zephir |
@fireburnheart2005 thank you .I had install php-mcrypt and rebuild with zephir,and then it also
Warning: Possible attempt to use non-object in "new" operator in /var/www/cphalcon/phalcon/mvc/model.zep on 584 [non-valid-new]
Warning: Function "phalcon_orm_singlequotes" does not exist at compile time in /var/www/cphalcon/phalcon/mvc/model/query.zep on 511 [nonexistent-function]
Warning: Variable 'sqlJoinConditions' was assigned for the first time in conditional branch, consider initialize it at its declaration in /var/www/cphalcon/phalcon/mvc/model/query.zep on 935 [conditional-initialization]
|
in the archlinux phalcon also does not work with php 5.6 |
Hey everyone, I am having some troubling issues with the view component, so decided to give 2.0 a go and see if its any different there. I am hitting the same 502 problem, just wanted to check if anyone managed to successfully run 2.0 + PHP 5.6.1 + Nginx on a Mac? |
@ianbytchek Could you please post a script/app allowing us to produce the problem? |
@phalcon, I'm at the moment stuck with nothing in the logs. I have the latest stable commit
Gets compiled and installed successfully.
When I try to run test (am I using the right ones? seems to be a few too many…):
|
@phalcon, when I try to run my own tests it just crashes with |
If you can post a simplified PHP file or files that always produce the segfault we could try to reproduce the problem here. |
Ok, I thought nothing is working, but some stuff are functioning. Can you point me in the right direction on two things. A. What tests should I run in 2.0 branch to ensure standard Phalcon tests are passing? |
Have a full environment to run all the Phalcon 2 tests would require several tools like: Memcached, Mysql, PostgreSQL, SQLite, Redis, Mongo, Xcache, Apc, Igbinary, etc: However you can run the tests this way:
Second part: phpunit --debug -c unit-tests/phpunit.xml --testsuite=stable |
I tried the second part, I'm really not sure why, but I get the
|
Ok, figured out PHPUnit issue, it doesn't like the global version, but works like this:
Produces segfault as well. Will report separately. |
Closing this as it's fixed, following last bug in #2914 |
Using this tutorial but upgrading the box and using PHP 5.6, the end result is yet another this:
The error happens when the code reaches this part in
bootstrap.php
:I can still
die()
before that line and it'll render.Note that I have disabled Xdebug as per @duythien's advice and set the debug flag to 1 in config, no effect.
Phalcon is successfully installed with version 2.0.0a and Zephir 0.4.6a.
If I can help with providing more information, let me know.
Want to back this issue? Place a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: