Skip to content
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

[BUG] \Phalcon\Debug code output #1329

Closed
quasipickle opened this issue Oct 3, 2013 · 18 comments
Closed

[BUG] \Phalcon\Debug code output #1329

quasipickle opened this issue Oct 3, 2013 · 18 comments
Labels
bug A bug report status: medium Medium

Comments

@quasipickle
Copy link
Contributor

When using \Phalcon\Debug the code output to show you where in the code the exception was thrown consists of nothing but opening PHP tags, ie:

<?php
<?php
<?php
<?php

It looks like the tags are from the correct file, as sometimes they're <?php and sometimes <?PHP.

Using v1.3.0.

The line numbers are all there and correct, and the correct number is highlighted, it's just that the code on that line is always an opening PHP tag.

@ghost
Copy link

ghost commented Oct 3, 2013

Could you please attach a test case? Thanks.

BTW, what version of Phalcon do you use?

@ghost
Copy link

ghost commented Oct 3, 2013

And do you have Zend Optimizer and/or ionCube Loader installed?

@quasipickle
Copy link
Contributor Author

Using v1.3.0, I don't have Zend Optimizer or ionCube Loader installed.

As far as a test, this simple setup replicates the problem

$Debug = new \Phalcon\Debug();
$Debug->listen();

class MyTest{
    public static function go(){
        throw new Exception('Test');
    }
}

MyTest::go();

@ghost
Copy link

ghost commented Oct 3, 2013

This is what I see: https://www.diigo.com/item/image/3zdqq/m40e

Looks good to me.

@quasipickle
Copy link
Contributor Author

Fair enough - obviously this bug doesn't affect everyone or it would have been reported a lot sooner. There's not a lot of room for error in the test code, so I don't know how this could be a user error.

@ghost
Copy link

ghost commented Oct 11, 2013

BTW, what lines endings do you use? \r, \n or \r\n?

@ghost
Copy link

ghost commented Oct 11, 2013

If you run

ini_set('auto_detect_line_endings', true);
$Debug = new \Phalcon\Debug();
$Debug->listen();

class MyTest{
    public static function go(){
        throw new Exception('Test');
    }
}

MyTest::go();

does the error go away?

@quasipickle
Copy link
Contributor Author

I'm running Debian, so I believe \n are line endings.

Your code snippet doesn't fix the problem.

@ghost
Copy link

ghost commented Oct 17, 2013

OK, I'll try to order a VPS with Debian to see if I can reproduce the issue.

Could you please:

  • tell me what Debian version you use (and if it is 32 or 64 bit)
  • post the output of dpkg -l | grep php
  • post the changes you have made to php.ini and related configuration files.

Thank you.

@quasipickle
Copy link
Contributor Author

  • uname -a gives: Linux store 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1+deb7u1 x86_64 GNU/Linux
  • As far as I can remember, I've not made any changes to any php or Apache config files (beyond setting up Apache with the proper hostname)
  • dpkg -l | grep php gives:
ii  libapache2-mod-php5                   5.4.4-14+deb7u4                    amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php-pear                              5.4.4-14+deb7u4                    all          PEAR - PHP Extension and Application Repository
ii  php5                                  5.4.4-14+deb7u4                    all          server-side, HTML-embedded scripting language (metapackage)
ii  php5-cli                              5.4.4-14+deb7u4                    amd64        command-line interpreter for the php5 scripting language
ii  php5-common                           5.4.4-14+deb7u4                    amd64        Common files for packages built from the php5 source
ii  php5-curl                             5.4.4-14+deb7u4                    amd64        CURL module for php5
ii  php5-dev                              5.4.4-14+deb7u4                    amd64        Files for PHP5 module development
ii  php5-gd                               5.4.4-14+deb7u4                    amd64        GD module for php5
ii  php5-imagick                          3.1.0~rc1-1+b2                     amd64        ImageMagick module for php5
ii  php5-ldap                             5.4.4-14+deb7u4                    amd64        LDAP module for php5
ii  php5-mcrypt                           5.4.4-14+deb7u4                    amd64        MCrypt module for php5
ii  php5-memcache                         3.0.6-6                            amd64        memcache extension module for PHP5
rc  php5-mysql                            5.4.4-14+deb7u2                    amd64        MySQL module for php5
ii  php5-mysqlnd                          5.4.4-14+deb7u4                    amd64        MySQL module for php5 (Native Driver)

@ghost
Copy link

ghost commented Oct 18, 2013

Still unable to reproduce :-(

http://162.243.62.32/1329.php

If you can give me your SSH public key, I will set up access to the server for you so that you can look if I am missing something.

@quasipickle
Copy link
Contributor Author

I'm afraid I wouldn't know what to look for. Is there a way to put Phalcon into a debug mode?

@quasipickle
Copy link
Contributor Author

I'm a jerk.

I thought I had 1.3 running, but I was running 1.2.something. Still a problem in the 1.2 branch, but if I'd answered properly when you first asked it could have saved you a lot of trouble. My sincere apologies for being an idiot.

@ghost
Copy link

ghost commented Oct 31, 2013

Just in case — works for me in 1.2.4/1.2.5, could you please check?

@quasipickle
Copy link
Contributor Author

Yes, 1.2.4 works as expected.

FYI - all the CSS & javascript loaded from static.phalconphp.com should be requested not from "http://", but from "//" - viewing an error page like this via https really breaks the page.

@ghost
Copy link

ghost commented Oct 31, 2013

//static.phalconphp.com will not work either — because there is no HTTPS version of static.phalconphp.com.

See #987

@quasipickle
Copy link
Contributor Author

@ghost
Copy link

ghost commented Oct 31, 2013

Nice, I will apply the patch to 1.2.5 then

@niden niden added bug A bug report status: medium Medium and removed Bug - Medium labels Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: medium Medium
Projects
None yet
Development

No branches or pull requests

2 participants