NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
[resolved] DebugBreak() not working


Joined: 16 Nov 2011
Posts: 4
Reply with quote
I've put DebugBreak() inside a constructor, and I also put a file_put_contents() in order to know if the constructor was executed:

Code:

    public function __construct()
    {
        file_put_contents('/var/www/projectX/logs/xxx.txt', 'the constructor was executed ' . date('H:i'));
        DebugBreak();
        //DebugBreak('44@***MY_IP***:7869');        // I've tried this also, doesn't work
        $this->mandatoryParams = array();
    }


The server is Ubuntu, and these are the directives set in the php.ini file:
debugger.enable_session_cookie On On
debugger.enabled On On
debugger.fail_silently Off Off
debugger.hosts_allow protected value protected value
debugger.hosts_deny protected value protected value
debugger.ignore_nops Off Off
debugger.JIT_enabled Off Off
debugger.JIT_host clienthost clienthost
debugger.JIT_level 3 3
debugger.JIT_port 7869 7869
debugger.net.chunksize 48000 48000
debugger.net.maxpacketsize 50000000 50000000
debugger.ports protected value protected value
debugger.profiler_enabled On On
debugger.session_nocache On On
debugger.ssl 2 2
debugger.timeout_seconds 300 300

Please help me, this is a huge project I am working on and I cannot do it without a debugger
View user's profileFind all posts by MathematicianSend private message


Joined: 16 Nov 2011
Posts: 4
Reply with quote
Also, DebugBreak() is working perfectly in some occasions.

In the one occasion that I really need - it's not working. The file is outside of webroot so maybe that is the reason. It is a class file that other php files inside webroot depend on and use.
View user's profileFind all posts by MathematicianSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
I'm wondering if PhpED cannot access the source file via FTP or mapping, it then ignores the DebugBreak. In the past I've debugged files within the root folder where I don't have source available and PhpED will download a copy by FTP if it can.

I've just added a file outside of the web root on a Windows server and DebugBreak works fine in there, but of course PhpED does have full access to the local file system.

One experiment you can try is to put a DebugBreak somewhere before that class gets loaded then see what happens if you try and single-step into the __construct(). If PhpED steps over it, that might confirm it is an issue with accessing source.

Later on I will do the same on a Linux server and see what happens.
View user's profileFind all posts by plugnplaySend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
Whilst I think PhpED can debug CLI PHP, I'm not so sure that the web debugging will do it. I'm not too sure how you are interfacing to the CLI PHP (is it through shell?) but the web debugger is via Apache PHP and CLI PHP is separate to Apache PHP.

This might be a question for Dmitri, so possibly best you put it through support. He has some really neat 'tricks' for debugging stuff.
View user's profileFind all posts by plugnplaySend private message


Joined: 16 Nov 2011
Posts: 4
Reply with quote
I found where the problem is. Here is the code:

Code:

    $sSmsData = urlencode(serialize($oSmsData));
    $arg = escapeshellarg($sSmsData);
    $command = dirname(__FILE__) . "/../../cli/smssend/process.php {$arg} > /dev/null 2>&1 &";
    exec($command);


I can debug up until a certain point. The command exec($command); executes the php file, and from that point I have no clue what happens. I cannot debug what is happening inside process.php which is executed as cli.
View user's profileFind all posts by MathematicianSend private message


Joined: 16 Nov 2011
Posts: 4
Reply with quote
I found the reason why it is not working.

I just started working in this company so I didn't know their system. There is a separate php.ini that is being processed when running scripts in CLI mode, and this file is not listed in phpinfo(). Luckily I found where it is located accidentally. So I entered the debugger settings and it worked! Smile

Anyway, thanks guys!
View user's profileFind all posts by MathematicianSend private message
[resolved] DebugBreak() not working
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic