The error messages that PHP throws up in WAMP are really ugly and very difficult to read when viewed through the dev console (when debugging xml requests).
Is there an easy way to improve them?
That format of error message is generated by XDEBUG.
XDEBUG is an additional feature that comes with WAMPServer and is a very useful debugging tool but it can be disabled if you really want to.
Edit the php.ini file ( using the wampmanager menus ) and near the bottom of the file you will find a line something like this ( your version numbers may be different )
; XDEBUG Extension
zend_extension = "d:/wamp/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5-5.5-vc11.dll"
Comment out the zend_extension line like this with a semi colon in column 1
;zend_extension = "d:/wamp/bin/php/php5.3.28/zend_ext/php_xdebug-2.2.5-5.3-vc9.dll"
Only comment it out as eventually you will probably want it again.
Related
I am beginner with Django and I'm using PyCharm IDE. I was watching a tutorial following along when I noticed my sqlite file that comes with Django had a question mark next to it (the guy in the video didnt have that). So I clicked it and it prompted me to associate my sqlite file with a certain file type. To experiment I selected the python(.py) file type. Now when I open up I get an error with corrupt code (or at least that's how it looks to me. The error is "File was loaded in the wrong encoding: 'UTF-8.'
When I click on that error message I am able to select from dozens of different encodings. I'm assuming that's the issue but I don't know for sure. Does anybody have a solution to this issue. Thanks.
I will add two screenshots to clarify what I mean.
Screenshot 1, list of options if I right click
Screenshot 2
I've spent the last few days trying to setup a test environment on my PC using WAMP to test a basic php/html website I have that I want to make a few basic changes on.
Now I am no programmer, infact a long way off, I dont know code at all. Its partly for this reason that I want to do changes in test mode, so ensure I dont screw things up.
So I finally got wamp up and running, but Im getting fatal errors all the time. I thought Id just dump all the files in the www/ folder and Bob would be my uncle. Of course its not that simple.
Is there any easy way I can do this instead of using WAMP?
After changing some of the path codes in the index.php file, I am now getting this error
( ! ) Fatal error: Class 'AutomotiveClass' not found in C:\wamp\www\repairservicemanuals.com\index.php on line 5
I dont get it because there is no file called AutomotiveClass, however there is a file called Automotive.Class .
Any help would be appreciated, either with what im doing wrong above, or a simpler way I can do this instead of wamp perhaps??
Thanks in advance from a n00b!
You should look into index.php at line 5.
I have a lot of trouble in debugging an ajax view. That's a view which expects a post request and then returns a json object. It causes an internal error 500, but eclipse doesn't give more information. The standard debug page cannot be accessed, because the view redirects if there is no post data.
What is the best approach to tackle these problems? Can I get eclipse/pydev to just tell me what the internal error 500 exactly is? Or do I really have to get a browser plugin and construct POST Data? (Which might be difficult, because a file upload is involved.)
Effectively I'm looking for a way to get the exception message in the console. Currently it just says:
[16/Feb/2015 17:38:03] "POST /fotos/upload/ HTTP/1.1" 500 10907
Which is not a big help.
Important: This question is about how to make debugging easier and not about fixing this particular view. So no need to ask for code or logfiles of that view. It's a general question about how to go ahead.
Thank you for your time!
Internal server errors can be generated in many ways. One of the most prominent ways is having a syntax error in the server code. The syntax error can range from typos to incorrect indentation(in python). Try debugging your python code. Try to find the point of error and see if there is a misspell or indentation error like using tabs instead of spaces(or vice-versa).
Also, if you're running Django in debug mode, open the link giving the error in a browser, and it will directly show you if there are any compile time errors in the code.
EDIT: And I totally missed the part where you mentioned that "the standard debug page cannot be accessed". Well in that case I'd resort to using standard print statements for debugging and check server logs for the point of failure.
Put a breakpoint (click on the left of the line or just tight click add Breakpoint to the spot). Once the source code gets to the point a debugging menu is opened containing:
-Variables and their values
-All your breakpoints
wondering if I could have the same behavior as Brackets like it previews the code on the right side but only opens the file if we do some edits.
Helpful when I'm just going through the files and not really changing anything but then at the end I've to close all.
Is there a setting in web storm that can help achieve the same behavior like brackets
Currently I may only suggest to use View | Quick Definition to preview file content instead of opening (has to be invoked for each file, which is possibly not what you are willing to do).
Other than that: https://youtrack.jetbrains.com/issue/IDEA-130918 -- star/vote/comment to get notified on progress.
P.S.
As stated in this comment they seems to worked on something like that already but quite possibly did not finished it for IDEA v14 release: in build 138.2502 there was an option to open file in "preview panel" first (and if satisfied -- move to editor) instead of opening in editor straight away. But it still a bit different to what Sublime does.
I just installed Django on my Mac and I am trying to figure out a way to edit the python modules directly from the terminal.
I know I can view the contents of a file using the less command in the command line, but is there a way I can edit Django modules from the command line, as well? It's just kind of annoying having to switch between the command line and a text editor, so I was hoping I could do everything in one spot.
Thanks,
Jerry
EDIT: rephrased.
There are lots of TUI text editors available for *nix. vim and emacs are popular, and are available in several forms for OS X.
This question is a little confused.
There's no such thing as "editing in Python", or "editing in Bash". I don't know what you're regarding as the "Python" that you have to switch to, but most people using a Mac edit their Python files in something like Textmate. That can be always running, and the Django development server automatically reloads when you save changes to any of the files in use, so this is the often most convenient way of doing it.
Bash is the shell that runs inside the terminal. Instead of talking about "editing in Bash", I expect you mean "editing in the terminal". Of course, there are hundreds of editors that run inside the terminal. One that comes installed on the Mac is vim, which I use all the time - but it has its fair share of idiosyncrasies, and takes a lot of getting used to.
However, if anything, editing in vim inside the terminal seems like it would involve more "switching" rather than less. You'd either need to have a separate terminal tab, and switch between the one running the server and the one running vim, or continually quit your server to go into vim.