comment code in netbeans? - php

a while ago i could comment any code in php with netbeans like this:
/*
*
*
*/
I just typed /* ENTER and netbeans gave me that lines above. then when i typed # it gave me a full list of all available tags (author, param and so on).
i reinstalled my mac and since then it hasnt worked.
someone knows why and how i can activate it? i installed the netbeans for php only.

Did you import from an old user profile by any chance? This happened to me once. I reset the preferences and it worked. Hope this helps.
Edit: The OP reported that you have to press /** ENTER rather than /* ENTER to get the comments working.

I would suggest 1 of the following:
1) Completely uninstall netbeans and install again
or
2) Check Tools->Options->Editor->Code Templates
You may also want to check the settings in
Check Tools->Options->Editor->Code Completion

Related

intelephense undefined constant/ vscode

code completion doesn't work (vscode on mac) when php open/ closing tags are on one line.
code completion works when three lines are used. please see screenshot.
how could this be resolved?
php code completion
cheers
PJ
What extension do you use? This one works fine for me (see screenshot). Also you should be able to activate it manually with CTRL+SPACE

How Can I see steps of running codes in phpstorm?

I have a problem in my PHP codes I cant find that. because dont display any warning or error and redirect to the main page of my website project and after many test couldnt find problem.
I want to see steps of running the code for example:
get values of $click and $usercode variables===> redirect to request_change.php and run mysql_query with value="select * from users where userid=65643"==> get $username ==> and else...
I can see some running steps by debugging but not exact that I Want and display many error about finding some directories in require_once function but while my webpages display and process information right by wamp.
Is any way to debugging same as that by Phpstorm or any other programs?
OR
How can I run My php code in phpstorm step-by-step and line-by-line??
Update:
I configured phpstorm for debugging but Just I can use debug and select one of page to debug.I checked all the settings steps that were done correctly But The step by step debug buttons is'nt active such as stepOver and step intro and else... In addition, after debugging the codes, the error : PHP Warning: include_once(): Failed opening '.\dref.php' for inclusion (include_path='.;C:\php\pear') in C:\wamp\www\srn\mrt\req_v.php on line 260
is displayed, while the same code works well in the wamp by Firefox
What should I do to solve this problem?
One of the most powerful and useful tools any developer could have is a debugger. I use xDebug myself. With it you can step through a program during execution and watch each method call, every variable value change, and every action the program does. With PHPStorm it is typically very easy to enable / use xDebug. This would be my recommendation for troubleshooting the issue you have.
References:
https://www.jetbrains.com/help/phpstorm/configuring-xdebug.html
https://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm
https://confluence.jetbrains.com/display/PhpStorm/Xdebug+Installation+Guide

PhpStorm debug console says "this view is read only"

I have xdebug stop in one breakpoint and I want to test some code in console but I have a problem.
I can't write in console and when I tried to paste it says "this view is read only"
I had the same issue with log files. Disabling all log highlight plugins (i.e. Ideolog) fixed it. They weren't highlighting anything anyway except scrollbar in green color.
Hope this helps somebody.
Sometimes this can happen for the log file that is too large. PhpStorm disables the possibility of editing it and adds “this view is read only” message.
If I'm reading your screenshot and what you wish to do correctly ... then PhpStorm version you are using is too old.
The Interactive Debug Console was added in v10 while you are using v9.0.2.
https://blog.jetbrains.com/phpstorm/2015/09/get-an-advantages-of-interactive-console-during-debugging-in-phpstorm-9-5-eap/
Upgrade your PhpStorm to the latest version -- which is 2017.1.2 right now.

xdebug with qcachegrind reports "There is no source available for the following function ..."

I am starting to use xdebug in combination with qcachegrind and first tests work well. The log file gets recorded and I can open it with qcachegrind. But now I have the issue that I dot't get detailed information for every function. For php::exec_curl I only get the information
"There is no source
available for the following function: php::curl_exec. This is because
its source file cannot be found: php:internal. Add the folder of this
file to the source folder list. This list can be found in the
configuration dialog.
I am using MAMP (/Applications/MAMP/bin/php/php5.6.2/bin/php) on OSX. My first try was to add simply the whole MAMP folder to the source list, but that did not work.
Now I wanted to ask if anybody maybe already had the same challenge and knows how to solve it?
exec_curl is an internal PHP function, meaning that it's been implemented in C and QCacheGrind doesn't have access to it's source nor to any trace of what that function did. For XDebug/PHP/QCacheGrind this function is just a black box, that takes some parameters and returns some input.
Why would you need to see the source? Frankly, you shouldn't care about what happens inside. All internal functions have been tested and proven to work.

Why am I not seeing any firephp output?

I am trying to get firephp to work. It was working as of last week and I don't know when
exactly it stopped working or what I changed.
I am now trying to do a simple firephp hello world.
<?php
require_once('FirePHPCore/FirePHP.class.php');
ob_start();
$firephp = FirePHP::getInstance(true);
$firephp->log('Hello', 'World');
require_once('FirePHPCore/fb.php');
$var='test';
fb($var);
FB::send($var);
ob_end_flush();
?>
There is no result in the firebug console window and no error messages I can find.
FireFox 5.0
FireBug 1.8.0
PHP 5.3.1
Firebug console and net panels are enabled. FirePHP is enabled.
In the net panel under the get request, I do not see any X-wf- headers.
Firebug has to have the Net panel enabled.
EDIT: Just press f12, click on the Net and if it says enable, click on enable :)
This one is ridiculous but I just wasted 30 mins, make sure you have your output set on 'All' and not 'Errors' or something like that in the firePHP console.
The FirePHP Extension now works again with Firebug 1.8: http://www.firephp.org/HQ/FinalRelease.htm
Explanation of what happened: http://www.christophdorn.com/Blog/2011/08/03/firephp-and-firebug-1-8/
It seems there is a knowned issue using the latest Firebug version 1.8 and Firefox 5:
http://groups.google.com/group/firephp-dev/browse_thread/thread/aa8ca7877f4f2d82?pli=1
Downgrading to version 1.7.3 solved the problem for me.
http://getfirebug.com/releases/firebug/1.7/firebug-1.7.3.xpi
You need to call ob_end_flush() for any output to get sent to the browser.
As I was led here by a google result motivated by the same problem I would like to add some perspective for posterity.
While testing in local environment on any of the new Windows OSs (Windwos 7 and above) you should check if your file is blocked .
That's right: in my case require_once didnt throw any fatal errors which it should if it couldnt find the file - so sth. had to be wrong with the file.
On Linux you would check permissions, on windows you need to check the file properties and see if the file is being blocked.
If it is and you have admin privileges, you can unblock it then and there.

Categories