I've setup a CakePHP project in Netbeans and use xdebug for debugging. When I start a debugging session, Netbeans stops in the root index.php file on every request. I have to press continue and then my breakpoints are hit.
Is there a way to configure xdebug to avoid this behavior? It's pretty tedious having to hit continue on every request.
Thanks!
Answer in another post: here. Issue was not specific to CakePHP, but rather PHP debugging in general with Netbeans.
Try setting web root folder to APP/webroot. Right click your project and choose properties, then set your source folder to webroot.
Ref: cakePHP debug Netbeans
Hope it helps
Sudhir's answer pointed me into the right direction.
The following worked for me:
Go to project properties.
Click on Run Configuration.
Click browse button next to [Index File] field.
Select app/webroot/index.php.
Breakpoints finally working now!!!
I am sooo happy XD
( PS. I just made the move from Windows to OS X. Whatever installation you are running, make sure you are editing the correct php.ini file. Even PHP veterans like myself sometimes still end up editing the wrong stupid file. )
Paul is correct. This is a netbeans issue, not CakePHP. Uncheck "Stop at First Line".
The larger issue that many people face is getting debugging working in general. If you set the index field as user787301 suggested, then the debugger will launch to webroot/index and throw an error. The solution is to only set Web Root in project properties -> sources as Sudhir suggested.
Related
I've been working on setting up correctly my xdebug debugger so I can improve my soft dev process, I manage to get xdebug working with phpstorm for some files that are outside of the project as in the first picture. But when it comes to debug some of the files that are inside of my mvc project (my app folder) I can set my debbuger to work properly and as far as now Im kind of stuck so any help would be welcome.
When I debbug phptest.php it work perfectly because it's an easy mapping
But when I need to debbug something like any php script on my controller folder for example, I can't get to there.
So please any ideas on how to do this.
Regards
Added a new screen shot of my mappings settings as #rafail pointed :)
For further or similar problems, my error was that i added index.php to my excluded paths and because of that I was never be able to debug, I deleted it and now it works fine.
especial thanks to Rafail Akhmetshin for his patience help.
Resume:
Check for exclude paths
Start debugging with phpStorm button
Make sure you are listening on the port
as a note point
make sure to check/uncheck
break at first line on php code
and break on first line when no mapping
I am using PHPStorm 10.0.3 on Windows 7, and I have had no problems working in my project so far. But for some reason, I come into work this morning and suddenly I'm not able to create a new file in any of my directories in my project? This is the error that's occurring:
The error appears 2 more times after I click OK.
I am still able to go into Windows Explorer and create the file manually, so that will tide me over until this problem is resolved.
Thank you all in advance for helping me with such a silly problem.
UPDATE:
It seems PHPStorm thinks the project is "read-only" because when I try and create a new file in the root of the project, I get the error "Cannot modify a read-only directory" followed by the path. I tried using the attrib windows command to remove all read-only attributes but it still hasn't worked.
I'm not sure what fixed the problem, but I tried two things and I thought both of them didn't work. I'll explain exactly what I did for reference to fix this problem.
Firstly, I should announce that I (used to) use Google Drive for all my projects for automated backups. I think that may have messed with the permissions, so I took all my projects out of Google Drive and stopped the process. Didn't fix.
So, I did a combination of the following:
Right-click on the folder, go Properties, and uncheck the Read-only box and make sure it affected subfolders and files too.
Change the permissions on the entire folder so that I was owner, and that "Everyone" had full access to it.
After both didn't seem to work, I tried making a file in the root directory and noticed something about it being read-only. I found out about Windows' "attrib" command, so I performed "attrib -r -s /S /D project-folder-name" whilst in the parent folder of my directory. This also didn't seem to work.
It was at this point I wanted to know if my other projects in the same directory were affected. I closed the problem project, opened another project and tried making a file anywhere. It worked. I tried this for them all. They all worked. So, I went back to the problem directory... and it worked.
I think after making all those changes, I hadn't actually restarted PHPStorm or changed project. I recommend, when trying each of my steps above, restart PHPStorm completely or at least change project to make sure the problem project is closed so you can properly test if the step worked.
I hope this helps someone in the future.
On Windows check if the working directory you are trying to save your code to is added to Ransomware protection. That might be what blocks your IDE from saving files in that specific directory.
You find Ransomware protection by searching for Windows Security. In Windows Security choose Virus & Threat Protection then choose Manage Ransomware Protection and click on Protected folders. If the folder is present try removing it from the list of protected folders.
I've been coding a project for some time. I'm quite new in Symfony2 and php frameworks, but find myself starting to understand it - which is great.
Now however something weird has happened, and I don't know where to start to look.
I was coding a scraper combining Symfony2 and casperjs - it has been working for some time and I was just dusting it off.
Suddenly I get a "connection reset" in Firefox. I try some other routes and they work fine. I try changing the route with a problem, but the same error pops up. I have tried the following:
delete the caches
isolating the casperjs part (works fine)
restart the server
restart apache
checking apache logfiles
checking symfony logfiles
But nothing of the above gives me any clues. Can the problem be with the virtual-host file when it is only a problem for a subpart of the site and not the site in general?
Any ideas is highly appreciated.
Thanks,
Rune
Found the problem in my code.
I did not read the error-log of the project vhost properly.
For others with similar problems the error-log is a great place to start :)
i am trying to use my workspace C:\Program Files (x86)\Zend\Apache2\htdocs, as i need to in order to use my Zend Server, but i get the error "workspace in use"
i have:
deleted all other copies of eclipse that i used
looked for a .metadata folder but not found one in my current eclipse folder (brand new eclipse PDT with Zend)
any idea as to what the problem can be? and how to fix it :D
thanks!
Check your workspace directory for :
.metadata and delete it (can be
hidden in your explorer)
.version.ini , open it an delete
all entrys
I think deleting .metadata will cause you to lose your tracked projects. Im not positive though ( don't really want to test it haha). However if you go in that folder (WORKSPACE/.metadata/) and delete the .lock file it should allow you to open the workspace. Hope this helps!
Just offering two other solutions for anyone who faces the workspace issue and ends up on this page.
This is one solution
and the other solution is if you were working on eclipse by connecting to a server via ssh.
In this case, the ssh might time out and your eclipse process would still be active on the server.
Solution is:
Type ps -aef | grep eclip
Find the process number of eclipse and type kill -9 process number
Bit of an obscure one this. My setup is all running on my local Windows machine; I've got NetBeans IDE installed, a local XAMPP server with XDebug running, and an installation of Moodle with some custom addons in the mod directory.
I can happily create breakpoints in PHP pages (including the main Moodle ones), but any breakpoints I place on php files in the mod directory never fire (on my mods, or any of the inbuilt ones). I thought Moodle might be doing some "magic" to display files in the mod directory, but my browser shows the url as http://localhost/moodle/mod/view.php - and that's the file I've set my breakpoint in.
Has anyone got any experience with debugging Moodle addins, or could possible point me in the direction of how to troubleshoot the breakpoint not firing? I've tried the Moodle site, but can't find anything relevent.
Actually, I think I've figured it out. If I tell it to debug that particular file it will 404 (it doesn't put the directories in, guess it's a bug), but if I then manually go to http://localhost/moodle/mod/view.php?XDEBUG_SESSION_START=netbeans-xdebug (which errors, no parameters are being passed in), and THEN manually navigate to Moodle then my mod breakpoints fire correctly.
All very bizarre, but it seems to be a usable workaround. I'm guessing the mods are running under some kind of different PHP session.
I'll keep this answer here in case anyone else has this bizarre problem.